Last active
February 22, 2016 20:03
-
-
Save wmfairuz/0862e22f1dfcc074e111 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function abc(z) { for(y in z) { console.log(y, typeof z[y], z[y]); if(typeof z[y] === 'object') { abc(z[y]); } } } | |
function abc(z, prop) { for(y in z) { if(typeof prop === 'undefined') { console.log(y, typeof z[y], z[y]); } else { if(y === prop) { console.log('FOUND'); } } if(typeof z[y] === 'object') { abc(z[y], prop); } } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment