public
Last active — forked from auser/gist:139933

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14
## Function
traverse("object", obj, function(key, val) {console.log(key, val)});
 
## Call
function traverse(key, jsonObj, func) {
if( typeof jsonObj == "object" ){
$.each(jsonObj, function(k,v) {
traverse(k,v);
})
} else {
console.log(func);
// func.apply(key,jsonObj);
}
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.