JavaScript Array valueOf() Method Last Updated : 13 Jul, 2023 Comments Improve Suggest changes Like Article Like Report The JavaScript Array valueOf() method in JavaScript is used to return the array. It is a default method of the Array Object. This method returns all the items in the same array. It will not change the original content of the array. It does not contain any parameter values. Syntax: array.valueOf()Parameters: This method does not accept any parameter. Return Value: It returns an Array. The below examples illustrate the JavaScript Array valueOf() Method: Example 1: In this example, we will see the basic use of the Array valueOf() method. JavaScript function func() { // Original array let array = ["GFG", "Geeks", "for", "Geeks"]; // Checking for condition in array let value = array.valueOf(); console.log(value); } func(); Output[ 'GFG', 'Geeks', 'for', 'Geeks' ]Example 2: In this example, we will show the use of valueOf method. JavaScript const sub = ["DS", "Algo", "PHP", "JS", "OS"]; console.log(sub.valueOf()); Output[ 'DS', 'Algo', 'PHP', 'JS', 'OS' ]We have a complete list of Javascript Array methods, to check those please go through this Javascript Array Complete reference article. Supported Browsers: The browsers supported by JavaScript Array valueOf() Method are listed below: Google ChromeInternet ExplorerFirefoxSafariOperaWe have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript. Comment More infoAdvertise with us Next Article JavaScript Array valueOf() Method M manaschhabra2 Follow Improve Article Tags : JavaScript Web Technologies javascript-array JavaScript-Methods Similar Reads JavaScript String valueOf() Method JavaScript String valueOf() method is an inbuilt method in JavaScript that is used to return the value of the given string. The valueOf() method in JavaScript returns the primitive value of a string. It does not modify the original string. This method can also be used to convert a string object into 2 min read JavaScript Array indexOf() Method The indexOf() method in JavaScript is used to find the position of the first occurrence of a specific value in an array. If the value is not present, it returns -1. This method is handy for quickly determining where a particular item is located within an array.Syntax:array.indexOf(element, start)Par 3 min read Java String valueOf() Method The valueOf() method of the String class in Java helps to convert various data types like integers, floats, booleans, and objects into their string representations. It makes it simple to work with string manipulation, logging, and displaying data efficiently.Example:To convert a number into text for 3 min read Java Guava | Doubles.indexOf(double[] array, double target) method with Examples Doubles.indexOf(double[] array, double target) method of Guava's Doubles Class accepts two parameters array and target. If the target exists within the array, the method returns the position of its first occurrence. If the target does not exist within the array, the method returns -1. Syntax: public 3 min read Java Guava | Doubles.indexOf(double[] array, double[] target) method with Examples Doubles.indexOf(double[] array, double[] target) method of Guava's Doubles Class accepts two parameters array and target. If the target exists within the array, the method returns the start position of its first occurrence. If the target does not exist within the array, the method returns -1. Syntax 3 min read Java Guava | Floats.indexOf(float[] array, float target) method with Examples Floats.indexOf(float[] array, float target) method of Guava's Floats Class accepts two parameters array and target. If the target exists within the array, the method returns the position of its first occurrence. If the target does not exist within the array, the method returns -1. Syntax: public sta 3 min read Ints indexOf() function | Guava | Java Guava's Ints.indexOf(int[] array, int target) method returns the index of the first appearance of the value target in array. Syntax: public static int indexOf(int[] array, int target) Parameters: This method accepts the following parameters: array: An array of int values, possibly empty. target: A p 2 min read Arraylist lastIndexOf() Method in Java with Examples In Java, the lastIndexOf() method is used to find the index of the last occurrence of a specified element in an ArrayList.Example 1: Here, we will use the lastIndexOf() method to find the index of the last occurrence of a specific element in an ArrayList of integers.Java// Java program to demonstrat 3 min read Stack indexOf(Object, int) method in Java with Example The Java.util.Stack.indexOf(Object element, int index) method is used to the index of the first occurrence of the specified element in this Stack, searching forwards from index, or returns -1 if the element is not found. More formally, returns the lowest index i such that (i >= index && O 2 min read Java Guava | Ints.indexOf(int[] array, int[] target) method with Examples Ints.indexOf(int[] array, int[] target) method of Guava's Ints Class accepts two parameters array and target. If the target exists within the array, the method returns the start position of its first occurrence. If the target does not exist within the array, the method returns -1. Syntax: public sta 3 min read Like