Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 834 Bytes

File metadata and controls

12 lines (9 loc) · 834 Bytes

Javascript Array Methods

JavaScript provides a rich set of methods for working with arrays. These methods make it easy to perform a variety of operations, such as adding and removing elements, finding elements, and iterating over arrays.

Useful Methods 📦

  • forEach(callback, thisArg): Executes a provided function once for each array element.
  • map(callback, thisArg): Creates a new array with the results of calling a provided function on every element.
  • filter(callback, thisArg): Creates a new array with all elements that pass the test implemented by the provided function.
  • includes(element, fromIndex): Checks if an array includes a certain element.
  • slice(start, end): Extracts a section of an array and returns a new array.

Further Reference: Array methods