I'm completely new to using underscore js, and I'm attempting to exclude a specific property from an Object. What I tried was
myObj = _.omit(myObj,name)
console.log(myObj);
However, the myObj still retains the property name
. Interestingly, if I do this it appears to work:
newMyObj= _.omit(myObj,name)
console.log (newMyObj)
it seemed to work fine. Am I making a mistake somewhere? Can someone offer any help? Here's how the myObj
is structured:
Angola: "4.134137685",Brunei: "2.532726835",Countries: "2004",Croatia: "1.717672961", keys: Array[11]
I am aiming to omit "keys," which happens to be an array of objects.
Thank you