A Comprehensive Reference of Array Methods and Properties in JavaScript

All these methods are used to interact with and manipulate arrays in different ways. They are part of the JavaScript specification and you don't have to load any extra library to use these functions. Arrays can prove very useful when you are storing, managing, and operating on a set of variables.

  1. from() — This method creates a new Array instance from an array-like or iterable object.
  2. isArray() — This method determines whether the passed value is an Array.
  3. of() — This method creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments.
  4. concat() — This method does not change the existing arrays, but instead returns a new array.
  5. copyWithin() — This method shallow copies part of an array to another location in the same array and returns it, without modifying its size.
  6. entries() — This method returns a new Array Iterator object that contains the key/value pairs for each index in the array.
  7. every() — This method tests whether all elements in the array pass the test implemented by the provided function.
  8. fill() — This method fills all the elements of an array from a start index to an end index with a static value.
  9. filter() — This method creates a new array with all elements that pass the test implemented by the provided function.
  10. find() — This method returns the value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.
  11. findIndex() — This method returns the index of the first element in the array that satisfies the provided testing function. Otherwise -1 is returned.
  12. forEach() — This method executes a provided function once for each array element.
  13. includes() — This method determines whether an array includes a certain element, returning true or false as appropriate.
  14. indexOf() — This method returns the first index at which a given element can be found in the array, or -1 if it is not present.
  15. join() — This method joins all elements of an array (or an array-like object) into a string and returns this string.
  16. keys() — This method returns a new Array Iterator object that contains the keys for each index in the array.
  17. lastIndexOf() — This method returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.
  18. map() — This method creates a new array with the results of calling a provided function on every element in the calling array.
  19. pop() — This method removes the last element from an array and returns that element..
  20. push() — This method adds one or more elements to the end of an array and returns the new length of the array.
  21. reduce() — This method applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
  22. reduceRight() — This method applies a function against an accumulator and each value of the array (from right-to-left) to reduce it to a single value.
  23. reverse() — This method reverses an array in place. The first array element becomes the last, and the last array element becomes the first.
  24. shift() — This method removes the first element from an array and returns that element.
  25. slice() — This method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included). The original array will not be modified.
  26. some() — This method tests whether at least one element in the array passes the test implemented by the provided function.
  27. sort() — This method sorts the elements of an array in place and returns the array. The sort is not necessarily stable. The default sort order is according to string Unicode code points.
  28. splice() — This method changes the contents of an array by removing existing elements and/or adding new elements.
  29. toLocaleString() — This methods and these Strings are separated by a locale-specific String (such as a comma “,”).
  30. toString() — This method returns a string representing the specified array and its elements.
  31. unshift() — This method adds one or more elements to the beginning of an array and returns the new length of the array.
  32. values() — This method returns a new Array Iterator object that contains the values for each index in the array.

Follow Us For Updates

FacebookTwitterGoogle+
Go To Top