json转为javascript数组

var alphaNum = { a: 1, b: 2, c: 3, d: 4, e: 5 };

var alphaNumOut = Object.keys(alphaNum).map(key => [key, alphaNum[key]]);

console.log(“alphaNumOut: “, alphaNumOut);

var alphaNumOut = [];
for (let element in alphaNum) alphaNumOut.push([element, alphaNum[element]]);


发表评论

电子邮件地址不会被公开。 必填项已用*标注