我有这个 JSON:
var myVar = {
"9":"Automotive & Industrial",
"1":"Books",
"7":"Clothing"
};
我想在开始时添加一个新元素,我想最终得到这个:
var myVar = { "5":"Electronics", "9":"Automotive & Industrial", "1":"Books", "7":"Clothing" };
我试过这个,但它不工作:
myVar.unshift({"5":"Electronics"});
谢谢!