以下是我的console.log(myJson)
[{"placeholdId":1,"itemId":null,"type":null},
{"placeholdId":2,"itemId":null,"type":null},
{"placeholdId":3,"itemId":null,"type":null},
{"placeholdId":4,"itemId":null,"type":null},
{"placeholdId":5,"itemId":5,"type":"food"},
{"placeholdId":6,"itemId":null,"type":"null"}]
如何根据placeholdId设置对象值的值?例如第5项,我想更改itemId并输入null。
我被困在这里..
var obj = $.parseJSON(json);
console.log(obj[4]);