I have this object result:
[{"id":1},{"id":2},{"id":3}]
How can I convert this to
[1,2,3]
in Lodash?
I have this object result:
[{"id":1},{"id":2},{"id":3}]
How can I convert this to
[1,2,3]
in Lodash?
You don't need lodash
for this, you can do this easy to achieve with a map
function.
var x = [{"id":1},{"id":2},{"id":3}]
var y = x.map(n => n.id);
console.log({y})