JSFiddle - React, Tailwind, and code Playground

by karim79

JavaScript

var list = {};
list['a'] = 'one';
list['b'] = 'two';
list['c'] = 'two';

var newObj = {
    "list": []
};

for (key in list) {
    newObj.list.push(list[key]);

}

alert(JSON.stringify(newObj));