paint-brush
The Superpowers of Array.reduce() Methodby@gilad-bar
354 reads
354 reads

The Superpowers of Array.reduce() Method

by Gilad Bar8mJanuary 11th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

ECMAScript 5 introduced array methods like isArray, forEach, map, filter, every, some. But let’s talk about my favorite one: the awesomereduce method. It executes a callback function (provided by the user) on each element of the array, resulting in a single output value. The return value is assigned to the accumulator, whose value is remembered across each iteration throughout the array and ultimately becomes the final, single resulting value. It allows you to take an array and reduce its values to basically anything that can be derived from data it holds.

Coin Mentioned

Mention Thumbnail
featured image - The Superpowers of Array.reduce() Method
Gilad Bar HackerNoon profile picture
Gilad Bar

Gilad Bar

@gilad-bar

Full Stack Developer @wework

About @gilad-bar
LEARN MORE ABOUT @GILAD-BAR'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Gilad Bar HackerNoon profile picture
Gilad Bar@gilad-bar
Full Stack Developer @wework

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite