List of utility methods to do Object Value Set
setDefault(key, value)Object.prototype.setDefault = function(key, value) { if (!this.hasOwnProperty(key)) { this[key] = value; return this[key]; }; | |
addSibling(k, v)Object.prototype.addSibling = function(k, v) { if (typeof this[k] === 'undefined') this[k] = v; return this[k]; |