У меня есть объект json, как показано ниже. где я хочу удалить запись "otherIndustry" и ее значение, используя приведенный ниже код, который не работает.
var updatedjsonobj = delete myjsonobj['otherIndustry'];
Как удалить специфический ключ объекта Json и его значение. Ниже мой пример объекта json, где я хочу удалить ключ "otherIndustry" и его значение.
var myjsonobj = {
"employeeid": "160915848",
"firstName": "tet",
"lastName": "test",
"email": "[email protected]",
"country": "Brasil",
"currentIndustry": "aaaaaaaaaaaaa",
"otherIndustry": "aaaaaaaaaaaaa",
"currentOrganization": "test",
"salary": "1234567"
};
delete myjsonobj ['otherIndustry'];
console.log(myjsonobj);
где журнал все еще печатает один и тот же объект, не удаляя запись "otherIndustry" с объекта.