Created
December 1, 2015 20:30
-
-
Save vanrez-nez/0961443f6cd092e37c3a to your computer and use it in GitHub Desktop.
Traverse all object properties recursively.
This file contains hidden or 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
private traverse(obj: any, interatee: Funcion) { | |
for (var i in obj) { | |
func.apply(this, [i, obj[i]]); | |
if (obj[i] !== null && typeof (obj[i]) == "object") { | |
this.traverse(obj[i], iteratee); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment