Create a gist now

Instantly share code, notes, and snippets.

## 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);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment