Node.js examples for Object:Property
Extract keys of an object
/**/*from ww w . j a v a 2s . co m*/ * Extract keys of an object * * Parameters: * (object) obj * * Returns: * (Array) array with all key of the object */ function keys(obj){ var keys = []; for(var key in obj){ if(obj.hasOwnProperty(key)){ keys.push(key); } } return keys; }