.valueOf()

The .valueOf() method returns the value of all the elements of the original array.

Syntax

Loading...

Examples

Create a new array with the same elements as programmingLanguages:

Loading...

Note: This method will not change the original array. However, if the original array or the variable which holds it (using the .valueOf() method) is manipulated, the value of the array will change accordingly.

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn JavaScript on Codecademy