StackOverflow - StackOverflow

Reduce with deconstruction or forEach - Iteration and Airbnb JavaScript Style Guide

If you're up for using a third party tool like lodash you can use mapValues:

_.mapValues(things, () => 'blue');

Was this helpful?

Have a different question?

Can't find the answer you're looking for? Submit your own question to our community.

🛎️ Get Weekly OTA Fixes

New answers, vendor issues, and updates — straight to your inbox.