How to delete key-value pair from an object?
本问题已经有最佳答案,请猛点这里访问。
我有一个变量数据,其中包含一些键值对,如下所示:
1 2 3 4 5 6 7 8 9 10 | var data = { "1": 127, "2": 236, "3": 348 } router.delete('/values/:id', function(req, res, next){ var id = req.params.id; }) |
如何删除键与id变量相等的键-值对?
https://developer.mozilla.org/en-us/docs/web/javascript/reference/operators/delete