JavaScript – Array includes() Method
The Array includes() method returns true if an array contains a specified value, and returns false if the value is not found.
The Array includes() method returns true if an array contains a specified value, and returns false if the value is not found.
The Array indexOf() method returns the first index position of a specified value, and returns -1 if the value is not found in the array.
The Array.isArray() method tests an object to determine if it’s an array. It returns true if an object is an array and false if the object is not.
The Array length property sets or returns the number of elements in an array.
The Array join() method returns an array as a string leaving the original array unchanged.
The Array map() method creates a new array by calling a function for every array item.
The Array keys() method returns an array iterator object containing the keys of a specified array.
The Array pop() method removes and returns the last element of an array, changing the original array.
The lastIndexOf() method returns the last position of a specified value, searching from right to left, returning -1 if the value is not found.
The Array.prototype property allows new properties and methods to be added to existing arrays.
The Array push() method adds new items to the end of an array, changing the length of the array.
The reduce() method executes a reducer function for every array item, returning a single value representing the function’s accumulated result.
The Array reduceRight() method executes a reducer function for every array item, working from right to left, returning a single value.
The Array reverse() method reverses the order of the items in an array, overwriting the original array.
The Array shift() method removes and returns the first element of an array, changing the original array.
The Array slice() method returns selected elements in an array as a new array, without changing the original array.
The Array some() method checks if any array elements pass a test by executing a callback function for each array element.
The Array sort() method sorts the elements of an array as strings in alphabetical and ascending order, overwriting the original array.
The Array splice() method adds and/or removes array elements, overwriting the original array.
The Array toString() method returns a string with array values separated by commas, and does not change the original array.