问题:
This question already has an answer here: 这个问题已经在这里有了答案:
Let's say we have an object with this format: 假设我们有一个具有这种格式的对象:
var thisIsObject= {
'Cow' : 'Moo',
'Cat' : 'Meow',
'Dog' : 'Bark'
};
I wanted to do a function that removes by key: 我想做一个通过键删除的函数:
removeFromObjectByKey('Cow');
解决方案:
参考一: https://stackoom.com/question/EUuL/如何从JavaScript对象中删除键-重复参考二: https://oldbug.net/q/EUuL/How-do-I-remove-a-key-from-a-JavaScript-object-duplicate
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4310856