1const _quote_filter = _.map(quote_state, (val, key) => { if (val) { return key }})console.log(_quote_filter) //=> [ 'btc', undefined, undefined ]
1function square(n) {
2 return n * n;
3}
4
5_.map([4, 8], square);
6// => [16, 64]
7
8_.map({ 'a': 4, 'b': 8 }, square);
9// => [16, 64] (iteration order is not guaranteed)
10
11var users = [
12 { 'user': 'barney' },
13 { 'user': 'fred' }
14];
15
16// The `_.property` iteratee shorthand.
17_.map(users, 'user');
18// => ['barney', 'fred']