It's a simple question i have, I have a javascript object which is declared like this -
adminID = {"Name": "","AdminId": ""}
At a later point in the code i assign it some values -
adminID = {"Name": "xyzabc","AdminId": "123123"}
Now, how can i assign the values back to null so my object looks like
adminID = {"Name": "","AdminId": ""}
Is there a smarter way to do it or should i specify all the keys to null individually.
Cheers!
You'd do it like this in JavaScript:
for(var p in adminID)
if(adminID.hasOwnProperty(p))
adminID[p] = '';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With