Image for post
Image for post

How to use Map, Filter and Reduce in JavaScript

Sunil Sandhu
Jun 30, 2018 · 3 min read

Map, Filter and Reduce are three major bits of functionality that arrived in Javascript as part of the ES6 spec back in 2015.

Okay, now that’s out of the way, let’s go!

let tasks = [
{
'name' : 'Buy milk from the shop',
'duration' : 20, 'priority' : 1
},
{
'name' : 'Clean the house',
'duration' : 120, 'priority' : 3
},
{
'name' : 'Study JS functions',
'duration' : 180, 'priority' : 1
},
]

And there we have it, some working examples of how to use map, filter and reduce 😄

JavaScript In Plain English

New articles every day.

Sign up for The Best Bits

By JavaScript In Plain English

A weekly round up of the best content from In Plain English, handpicked by our Founder @sunilsandhu Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Sunil Sandhu

Written by

Software Engineer, Founder of PlainEnglish.io, YouTuber youtube.com/decodedx

JavaScript In Plain English

New articles every day.

Sunil Sandhu

Written by

Software Engineer, Founder of PlainEnglish.io, YouTuber youtube.com/decodedx

JavaScript In Plain English

New articles every day.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

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