DEV Community

Discussion on: JavaScript Array methods explained

Collapse
 
adrianschmidt91 profile image
Adrian Schmidt

Great article!

What about Array.reduce()?

Collapse
 
denicmarko profile image
Marko Denic

A good point. I'll add one example for it.

In the meantime, check this article:

markodenic.com/10-javascript-array...

Collapse
 
zaff profile image
Zafer Gurel

const fruits = ['🍉', '🍎', '🍒', '🍌'];
const initialValue = 'Fruits I Love: ';
fruits.reduce((previous, current) => previous + ' ' + current, initialValue);

Enter fullscreen mode Exit fullscreen mode