Easy Tutorial
❮ Event Timestamp Prop Range Value ❯

JavaScript valueOf() Method

JavaScript Array Object

Example

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

fruits.valueOf() returns the same value as fruits.

v output result is:


Definition and Usage

The valueOf() method returns the primitive value of the Array object.

This primitive value is inherited by all objects derived from the Array object.

The valueOf() method is typically called automatically by JavaScript in the background and does not explicitly appear in the code.

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


Browser Support

All major browsers support valueOf().


Syntax

Return Value

Type Description
Array valueOf() returns the array value

JavaScript Array Object

❮ Event Timestamp Prop Range Value ❯