JavaScript Array valueOf() Method

Definition and usage

valueOf() The method returns an array.

valueOf() The method is the default method of the array object.

Note:valueOf() The method does not change the original array.

Example

valueOf() is the default method of the array object.

var fruits = ["Banana", "Orange", "Apple", "Mango"];
var v = fruits.valueOf(); // Returns fruits

The result returned by fruits.valueOf() is the same as fruits.

Try it yourself

Syntax

array.valueOf()

Parameters

No parameters.

Technical details

Return value: Array. The valueOf() method returns itself.
JavaScript version: ECMAScript 1

Browser support

All browsers fully support valueOf() Method:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support

Related Pages

Tutorial:JavaScript Array

Tutorial:JavaScript Array Const

Tutorial:JavaScript Array Methods

Tutorial:JavaScript Sort Array

Tutorial:JavaScript Array Iteration