js object clear
// for enumerable and non-enumerable of an object with proto chain
var props = Object.getOwnPropertyNames(obj);
for (var i = 0; i < props.length; i++) {
delete obj[props[i]];
}
// for enumerable properties of shallow/plain object
for (var key in obj) {
// this check can be safely omitted in modern JS engines
// if (obj.hasOwnProperty(key))
delete obj[key];
}
Also in JavaScript:
- angular how to get previous state
- button click function in js
- how can prevent morgan to work in test enviroment
- jquery check if click to this self not this child
- js regex password
- remove letter js
- pull out only text from element javascript
- package.json tilde vs caret
- sending value in input angular material
- in out time of nodes
- react redux
- submitting login and sign up forms using AJAX
- lexical scope javascript
- js add
- implicit return arrow function
- how to export module in node js
- javascript template string
- how to disable menu bar in browser using javascript
- js math random
- p5 js functions
- node js how to basic auth to specific urk
- convert shp to geojson python
- javascript if field exists
- hide checkbox jquery