我想从JSON中删除JSON元素或整行。
I want to remove JSON element or one whole row from JSON.
我有以下JSON字符串:
I have following JSON string:
{ "result":[ { "FirstName": "Test1", "LastName": "User", }, { "FirstName": "user", "LastName": "user", }, { "FirstName": "Ropbert", "LastName": "Jones", }, { "FirstName": "hitesh", "LastName": "prajapti", } ] }推荐答案
var json = { ... }; var key = "foo"; delete json[key]; // Removes json.foo from the dictionary.
您可以使用 splice 从数组中删除元素。
You can use splice to remove elements from an array.