Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delete multiple keys from object javascript

var obj = {a: 1, b: 2, c: 3, d: 4, e: 5 };

['c', 'e'].forEach(e => delete obj[e]);

// obj is now {a:1, b:2, d:4}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #multiple #keys #object #javascript
ADD COMMENT
Topic
Name
2+4 =