Last active
June 23, 2021 04:29
-
-
Save arisawali2014/4be5e7379b591f91718dfbe420ff449f to your computer and use it in GitHub Desktop.
Revisions
-
arisawali2014 revised this gist
Jun 23, 2021 . No changes.There are no files selected for viewing
-
arisawali2014 revised this gist
Jun 23, 2021 . No changes.There are no files selected for viewing
-
arisawali2014 created this gist
Jun 23, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ var data = [ {id: "1", name: "Snatch", type: "crime"}, {id: "2", name: "Witches of Eastwick", type: "comedy"}, {id: "3", name: "X-Men", type: "action"}, {id: "4", name: "Ordinary People", type: "drama"}, {id: "5", name: "Billy Elliot", type: "drama"}, {id: "6", name: "Toy Story", type: "children"} ]; function RemoveNode(id) { return data.filter(function(emp) { if (emp.id == id) { return false; } return true; }); } var newData = RemoveNode("1"); document.write(JSON.stringify(newData, 0, 4));