DEV Community

Discussion on: JavaScript Map() Method Explained by Going On a Hike

jishvi profile image
Jishnu Vasanth • Edited on

Example #1

let startHike= [96, 84, 92, 98, 94]; 
let summit =>hikerEnergy / 2); 

Example #2

let startHike= [
     {name:"dave", water: 86},
     {name:"andrea", water: 56},
     {name:"maria", water: 42},
     {name:"nico", water: 60},
     {name:"will", water: 36} 
let summit = => hikerEnergy['water']);

More concisely with arrow function.

kamui62552688 profile image

I found for some reason arrow function less readable

chizom_ profile image
Chizom Echehieuka

I find it very readable and clean. At first it didnt make any sense until I read about it on

It made a lot of sense after that.

kbk0125 profile image
Kevin Kononenko Author

Good call, Jishnu. It is always hard for me to tell when I write whether the audience will know about arrow functions. In the community, people probably do!