我有一個對象myObj.employees
看起來像這樣:如何將json數組添加到現有數組中的對象?
{"employees":[{"key":1419,"rankid":8,"label":"bob (47)","exclude":false,"color":"#ffffff","textColor":"#330000","active_events":[]},{"key":1420,"rankid":8,"label":"john (48)","exclude":false,"color":"#ffffff","textColor":"#330000","active_events":[]}]}
我怎麼添加項目active_events
爲key = 1419
?
您的公司從事什麼語言?請添加適當的標籤。 –
myObj.employees對象是否包含一個名爲'employees'的屬性,因此它需要作爲myObj.employees.employees來訪問,還是'myObj'直接包含'employees'數組? –