The JavaScript string valueOf() method is used to find out the primitive value of String object. This method is invoked by JavaScript automatically. Thus, there is no requirement to call it explicitly in the code.
This method is the default method of the array object. Array.valueOf() will return the same as Array
array.valueOf()
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var v = fruits.valueOf();