Skip to main content
Correct call to Lodash#pick
Source Link
Ygg
  • 3.9k
  • 1
  • 19
  • 23

I suggest taking a look at Lodash; it has a lot of great utility functions.

For example pick() would be exactly what you seek:

var subset = _(elmo).pick('color'elmo, 'height'['color', 'height']);

fiddle

I suggest taking a look at Lodash; it has a lot of great utility functions.

For example pick() would be exactly what you seek:

var subset = _(elmo).pick('color', 'height');

fiddle

I suggest taking a look at Lodash; it has a lot of great utility functions.

For example pick() would be exactly what you seek:

var subset = _.pick(elmo, ['color', 'height']);

fiddle

Change form suggesting Underscore to Lodash
Source Link
Ygg
  • 3.9k
  • 1
  • 19
  • 23

I suggest taking a look at Underscore.jsLodash; it has a lot of great utility functions.

For example pick()pick() would be exactly what you seek:

var subset = _(elmo).pick('color', 'height');

fiddlefiddle

I suggest taking a look at Underscore.js; it has a lot of great utility functions.

For example pick() would be exactly what you seek:

var subset = _(elmo).pick('color', 'height');

fiddle

I suggest taking a look at Lodash; it has a lot of great utility functions.

For example pick() would be exactly what you seek:

var subset = _(elmo).pick('color', 'height');

fiddle

Source Link
Ygg
  • 3.9k
  • 1
  • 19
  • 23

I suggest taking a look at Underscore.js; it has a lot of great utility functions.

For example pick() would be exactly what you seek:

var subset = _(elmo).pick('color', 'height');

fiddle