Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Please suggest how to convert object to array in javascript

Ketan Pandey
Tera Expert

Please suggest how to convert object to array in javascript

5 REPLIES 5

manjusha_
Kilo Sage

@Ketan Pandey 

 

var testarr= {};

var secArr = [];

 

testarr.test1 = "ABC";

testarr.test2 = "DEF";

secArr.push(JSON.stringify(testarr));

 gs.print(secArr);

 

Execute above script in background script and its result will as below-

Script: {"test1":"ABC","test2":"DEF"}

 

If this does not help you ,just share your object and required output

 

Thanks,

Manjusha Bangale