假设我的json对象是这样的var User: {"phone": {"key1": "value", "key2": "value"}}然后,我要删除key1属性,用下面代码就能删除delete User.phone.key1;但是,当我要删除的key是个传入的变量,下面这段代码就不管用了var type = "key1";
delete User.phone.type;这是为什么呢?
添加回答
举报
0/150
提交
取消