Skip to content

Instantly share code, notes, and snippets.

@vanrez-nez
Created December 1, 2015 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanrez-nez/0961443f6cd092e37c3a to your computer and use it in GitHub Desktop.
Save vanrez-nez/0961443f6cd092e37c3a to your computer and use it in GitHub Desktop.
Traverse all object properties recursively.
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