I have the following code, can anyone tell the difference:
const _ = require(\'lodash\');
const arr = [
{\'fname\':\'Ali\', \'lname\': \'Yousuf\'},
In the way you're using them, they basically do the same. That's why .pluck() was removed from Lodash v4.0.0 in favor of using .map() with a string as second argument.
Here's the relevant excerpt from the changelog:
Removed
_.pluckin favor of_.mapwith iteratee shorthandvar objects = [{ 'a': 1 }, { 'a': 2 }]; // in 3.10.1 _.pluck(objects, 'a'); // → [1, 2] _.map(objects, 'a'); // → [1, 2] // in 4.0.0 _.map(objects, 'a'); // → [1, 2]