我想更新與陣列的動態對象我怎麼能做到這一點如何更新JSON陣列,動態密鑰
var groupData = [
{
"Logon": 0,
"Logon": 1
}, {
"Logoff": 0
}, {
"Special Logon": 0
}, {
"Other System Events": 0
}, {
"System Integrity": 0
}, {
"Other Logon/Logoff Events": 0
}, {
"Security State Change": 0
}, {
"Audit Policy Change": 0
}, {
"Security Group Management": 0
}
];
var key = logon;
var val = 10;
groupData[0].key = val;
actully我動態獲取密鑰。我不知道我的數組中有哪個密鑰,爲什麼我要根據動態密鑰 – Bhagya
更新'{「登錄」:0,「登錄」:1} ==>'''登錄「:1}' –
是,我明白了。 ':)'檢查答案。 ':)' –