Please suggest how to convert object to array in javascript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2023 10:09 PM
Please suggest how to convert object to array in javascript
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 02:39 AM - edited ‎08-30-2023 02:39 AM
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