Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Delete object properties in JavaScript

for (var k in myObj) {
    if (k !== 'p1' && k !== 'p2' && k !== 'p100') {
        delete myObj[k];
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Delete #object #properties #JavaScript
ADD COMMENT
Topic
Name
8+2 =