Array helpers for Javascript

.forEach()

arr.forEach(callback(currentValue[, index[, array]]) {
// execute something
}[, thisArg]);
forEach() function

.filter()

let newArray = arr.filter(callback(currentValue[, index[, array]]) {
// return element for newArray, if true
}[, thisArg]);
filter() function

.find()

arr.find(callback(element[, index[, array]])[, thisArg])
find() function

.map()

let newArray = arr.map(callback(currentValue[, index[, array]]) {
// return element for newArray, after executing something
}[, thisArg]);
map() function

.reduce()

arr.reduce(callback( accumulator, currentValue, [, index[, array]] )[, initialValue])
reduce() function

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

MoleculerJS with Swagger

Upload Images to AWS S3 in React Native 0.60+

Feeling the ‘Buzz’

Getting Started with ReactJs

Hello No WordPress Gutenberg! Hello ClassicPress

First Unique Character in a String, JavaScript, LeetCode

How to Create and Customize react-content-loader

Word To Palindrome Using Typescript/JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Meriem

Meriem

More from Medium

JavaScript Utility Methods in Detail

Intro to Javascript Event KeyCodes

Multiple Copy Paste for VS Code

How to use the includes() Array method on a Bootcamp API