Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thetentomushi/array-functions-in-js
List of array functions in JS
https://github.com/thetentomushi/array-functions-in-js
Last synced: about 1 month ago
JSON representation
List of array functions in JS
- Host: GitHub
- URL: https://github.com/thetentomushi/array-functions-in-js
- Owner: thetentomushi
- Created: 2023-02-21T14:51:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-21T14:55:47.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T19:05:48.790Z (3 months ago)
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Array functions in JS
List of all the Array functions in JavaScript:
- **concat()** - Joins two or more arrays, and returns a new array.
- **copyWithin()** - Copies array elements within the array, to and from specified positions.
- **entries()** - Returns a key/value pair Array Iteration Object.
- **every()** - Checks if every element in an array pass a test.
- **fill()** - Fill the elements in an array with a static value.
- **filter()** - Creates a new array with every element in an array that pass a test.
- **find()** - Returns the value of the first element in an array that pass a test.
- **findIndex()** - Returns the index of the first element in an array that pass a test.
- **flat()** - Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.
- **flatMap()** - Creates a new array with the results of calling a function for every element in an array, and then flattening the result.
- **forEach()** - Calls a function for each array element.
- **from()** - Creates an array from an object.
- **includes()** - Checks if an array contains a specified element.
- **indexOf()** - Search the array for an element and returns its position.
- **isArray()** - Checks whether an object is an array.
- **join()** - Joins all array elements into a string.
- **keys()** - Returns a Array Iteration Object, containing the keys of the original array.
- **lastIndexOf()** - Search the array for an element, starting at the end, and returns its position.
- **map()** - Creates a new array with the results of calling a function for every element in an array.
- **pop()** - Removes the last element of an array, and returns that element.
- **push()** - Adds new elements to the end of an array, and returns the new length.
- **reduce()** - Reduce the values of an array to a single value (from left-to-right).
- **reduceRight()** - Reduce the values of an array to a single value (from right-to-left).
- **reverse()** - Reverses the order of the elements in an array.
- **shift()** - Removes the first element of an array, and returns that element.
- **slice()** - Selects a part of an array, and returns the new array.
- **some()** - Checks if any of the elements in an array pass a test.
- **sort()** - Sorts the elements of an array.
- **splice()** - Adds/Removes elements from an array.
- **toString()** - Converts an array to a string, and returns the result.
- **unshift()** - Adds new elements to the beginning of an array, and returns the new length.
- **values()** - Returns a Array Iteration Object, containing the values of the original array.Note that some of these functions, like map() and filter(), return a new array, while others, like pop() and shift(), modify the original array. Also, some of these functions, like indexOf() and lastIndexOf(), return the index of an element, while others, like every() and some(), return a boolean value based on whether all or some of the elements in the array pass a test.