如果我有一个值为
{"__v":0,"_id":"528277c808cab8ac2b000001","password":"password",
"userId":5,"userName":"Austinsss","$$hashKey":"00F"}
我怎样才能从对象中完全删除 "$$hashKey":"00F" 。
如果我有一个值为
{"__v":0,"_id":"528277c808cab8ac2b000001","password":"password",
"userId":5,"userName":"Austinsss","$$hashKey":"00F"}
我怎样才能从对象中完全删除 "$$hashKey":"00F" 。
使用delete
(MDN):
var foo = {"__v":0,"_id":"528277c808cab8ac2b000001","password":"password",
"userId":5,"userName":"Austinsss","$$hashKey":"00F"};
delete foo.$$hashKey;
如果您的键中有奇数字符,您也可以使用括号表示法:
delete foo['$$HashKey'];
怎么样
delete obj.$$hashKey
delete
它!
delete objname["$$hashKey"];