var obj = {type: "beetle", price : "xxx", popular: "yes" ,.... };
If I want to remove all the properties from obj
, what is the correct way to do it?
Should I use
... and so on.delete obj.type; delete obj.price; delete obj.popular
Or should I set
obj = null;
?Or will letting
obj
go out of scope automatically delete the properties?