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

Integrating Stripe Payments into Angular and Nodejs applications

Testing an Apollo GraphQL server using apollo-server-testing, Jest and msw

How to build a VueJS frontend for your machine learning prediction input and output

Angular structural directives — implement your own *ngIf

Serverless Mobile App with AWS Amplify and React Native

Let vs Var, A Simple Answer

Some Useful Interview Questions For React

React Higher-Order Components

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

What is Reactive JavaScript?

Advance Objects: JavaScript

JavaScript - Callbacks, Promises, and Async/Await

10 Most Popular Software Development Articles