JavaScript toString()
The JavaScript toString() method is an inbuilt function that returns the string itself. It does not modify the original string and it can be used to convert a string object to its string representation.
Syntax:
string.toString()
Parameters: It does not accept any parameter.
JavaScript String valueOf()
JavaScript String valueOf() method is an inbuilt method in JavaScript that is used to return the value of the given string. The valueOf() method in JavaScript returns the primitive value of a string. It does not modify the original string. This method can also be used to convert a string object into a string.
Syntax:
string.valueOf()
JavaScript Array fill() Method
The JavaScript Array fill() Method fills a given range of array elements with the given value. This method is used to manipulate the existing array according to our needs.
Syntax:
arr.fill(value,start,end)