Thursday 27 February 2020

How to omit a key inside array of objects?

For example if I have a JSON like this :var a = {'name' : 'OBJ NAME','place' : {'location' : UK},layout : [{id : 1, name : 'ONE'},{id : 2, name : 'TWO'},{id : 3, name : 'THREE'}]}Now if I want to omit id from layout array, how do I do this?I know that by _.omit(a, ['place.location']) can be used to omit nested properties but I don't know how to do this on an array. Is there any way to do this?

Submitted February 27, 2020 at 06:20PM by GhostFoxGod

No comments:

Post a Comment