Check out example codes for "lodash map". It will help you in understanding the concepts better.

Code Example 1

const _quote_filter = _.map(quote_state, (val, key) => {   if (val) {      return key   }})console.log(_quote_filter) //=> [ 'btc', undefined, undefined ]

Code Example 2

var title = [];
for (var i=0; i<3; i++) {
    title[i] = {
        name: "name" + i+1,
        age: "age" + i+1,
        hometown: "hometown" + i+1
    };
}
console.log(title);
// output will be:
// [ { name: 'name1', age: 'age1', hometown: 'hometown1' },
//   { name: 'name2', age: 'age2', hometown: 'hometown2' },
//   { name: 'name3', age: 'age3', hometown: 'hometown3' } ]

Code Example 3

_.each(markets, (obj, key) => {   obj.symbol = key})console.log(markets)//=> {       'BTC/USD': { buys: 0, sells: 3, symbol: 'BTC/USD' },       'DASH/BTC': { buys: 3, sells: 1, symbol: 'DASH/BTC' },       'ETH/BTC': { buys: 3, sells: 2, symbol: 'ETH/BTC' }    }

Learn ReactJs, React Native from akashmittal.com