Skip to content

Instantly share code, notes, and snippets.

@a-v-l
Created August 12, 2015 09:37
Show Gist options
  • Select an option

  • Save a-v-l/ef8e8216bff709a81fb8 to your computer and use it in GitHub Desktop.

Select an option

Save a-v-l/ef8e8216bff709a81fb8 to your computer and use it in GitHub Desktop.
Function to reveal the structure of an javascript web app
function revealApp(app, tab) {
tab = tab || "";
Object.getOwnPropertyNames(app).forEach(function(key, idx, array) {
var val = app[key],
type = typeof(val),
output = type !== "function" ? ( type !== "object" ? val : '' ) : 'function()';
console.log(tab + key + ' -> ' + output);
if ( type === 'object' && val != null ) {
showall(val, tab + " ");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment