Node.js examples for Object:Property
Try to get property
function tryGetProperty ( object /*, propertyName1, ... */ ) { for ( var i = 1; i < arguments.length; i += 1 ) {/* ww w .jav a 2 s .co m*/ if ( object === undefined ) return; var propertyName = arguments[ i ]; object = object[ propertyName ]; } return object; }