Sign in
Log inSign up

What's the best way to map over an Object/Array in JavaScript (ES6)?

Fernando Morris's photo
Fernando Morris
·Dec 1, 2016

Sometimes I need to map both objects properties and arrays. Since Array.map supports only arrays, I end up using lodash/map (Lodash supports both objects and arrays).

What's the recommended way to handle this?