Shorthand Javascript code to set all keys in an array to empty ("") strings -


i have array shown in code below. how reset these strings "", without having explicitly refer each key? there way can refer parent object , children = ""?

rmtdata = {   firstname : "jane",   lastname  : "doe",   gender    : "f",   details   : "therapist" };  //other code here...  //then reset variables here:  rmtdata.firstname = ""; rmtdata.lastname  = ""; rmtdata.gender    = ""; rmtdata.details   = ""; 

for (var key in rmtdata ) rmtdata[key] = ""; 

and yes, object


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -