valueOf Method (Array)

Returns the primitive value of the specified object.

array.valueOf()

This method has no parameters.

Returns the array instance.

In the following example, the instantiated array object is the same as the return value of this method.

var arr = [1, 2, 3, 4];
var s = arr.valueOf();

if (arr === s)
document.write("same");
else
document.write("different");

// Output:
// same

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Show:
© 2015 Microsoft