NewDash

    Function map

    • Creates an array of values by running each element in collection thru iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).

      Many lodash methods are guarded to work as iteratee for methods like every, filter, map, mapValues, reject, and some.

      The guarded methods are: ary, chunk, curry, curryRight, drop, dropRight, every, fill, invert, parseInt, random, range, rangeRight, repeat, sampleSize, slice, some, sortBy, split, take, takeRight, template, trim, trimEnd, trimStart, and words

      Type Parameters

      • T extends any[] | []

      Parameters

      • collection: T

      Returns Tuple<T>

      5.0.0

      function square(n) {
      return n * n;
      }

      map([4, 8], square);
      // => [16, 64]

      map({ 'a': 4, 'b': 8 }, square);
      // => [16, 64] (iteration order is not guaranteed)

      var users = [
      { 'user': 'barney' },
      { 'user': 'fred' }
      ];

      map(users, 'user');
      // => ['barney', 'fred']
    • Creates an array of values by running each element in collection thru iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).

      Many lodash methods are guarded to work as iteratee for methods like every, filter, map, mapValues, reject, and some.

      The guarded methods are: ary, chunk, curry, curryRight, drop, dropRight, every, fill, invert, parseInt, random, range, rangeRight, repeat, sampleSize, slice, some, sortBy, split, take, takeRight, template, trim, trimEnd, trimStart, and words

      Type Parameters

      • T
      • R = any

      Parameters

      • collection: ArrayLike<T>
      • Optionaliteratee: ArrayIteratee<T, R>

      Returns R[]

      5.0.0

      function square(n) {
      return n * n;
      }

      map([4, 8], square);
      // => [16, 64]

      map({ 'a': 4, 'b': 8 }, square);
      // => [16, 64] (iteration order is not guaranteed)

      var users = [
      { 'user': 'barney' },
      { 'user': 'fred' }
      ];

      map(users, 'user');
      // => ['barney', 'fred']
    • Creates an array of values by running each element in collection thru iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).

      Many lodash methods are guarded to work as iteratee for methods like every, filter, map, mapValues, reject, and some.

      The guarded methods are: ary, chunk, curry, curryRight, drop, dropRight, every, fill, invert, parseInt, random, range, rangeRight, repeat, sampleSize, slice, some, sortBy, split, take, takeRight, template, trim, trimEnd, trimStart, and words

      Type Parameters

      • T
      • R = any

      Parameters

      • collection: Record<string, T>
      • Optionaliteratee: RecordIteratee<T, R>

      Returns R[]

      5.0.0

      function square(n) {
      return n * n;
      }

      map([4, 8], square);
      // => [16, 64]

      map({ 'a': 4, 'b': 8 }, square);
      // => [16, 64] (iteration order is not guaranteed)

      var users = [
      { 'user': 'barney' },
      { 'user': 'fred' }
      ];

      map(users, 'user');
      // => ['barney', 'fred']
    • Creates an array of values by running each element in collection thru iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).

      Many lodash methods are guarded to work as iteratee for methods like every, filter, map, mapValues, reject, and some.

      The guarded methods are: ary, chunk, curry, curryRight, drop, dropRight, every, fill, invert, parseInt, random, range, rangeRight, repeat, sampleSize, slice, some, sortBy, split, take, takeRight, template, trim, trimEnd, trimStart, and words

      Parameters

      • collection: any
      • Optionaliteratee: any

      Returns []

      5.0.0

      function square(n) {
      return n * n;
      }

      map([4, 8], square);
      // => [16, 64]

      map({ 'a': 4, 'b': 8 }, square);
      // => [16, 64] (iteration order is not guaranteed)

      var users = [
      { 'user': 'barney' },
      { 'user': 'fred' }
      ];

      map(users, 'user');
      // => ['barney', 'fred']
    MMNEPVFCICPMFPCPTTAAATR