valueOf Method (Array)

Returns the primitive value of the specified object.

Syntax


array.valueOf()  

Parameters

This method has no parameters.

Return Value

Returns the array instance.

Remarks

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  

Requirements

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.