JSON 数组
如何修改 JSON 对象的数组值。
var myObj, i, x = ""; myObj = { "name": "Bill Gates", "age": 62, "cars": ["Porsche", "BMW", "Volvo"] } myObj.cars[2] = "Mercedes Benz"; for (i in myObj.cars) { x += myObj.cars[i] + "
"; } document.getElementById("demo").innerHTML = x;