Skip to content

Instantly share code, notes, and snippets.

@andrijac
Last active December 9, 2019 12:51
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 andrijac/004486f8d9c5e4728a5d15dec030d5dc to your computer and use it in GitHub Desktop.
Save andrijac/004486f8d9c5e4728a5d15dec030d5dc to your computer and use it in GitHub Desktop.
(function(obj){
let arr = [];
for(w in obj) {
arr.push({
'name': w,
'type': getType(obj[w])
});
}
console.dir(arr);
function getType(v) {
return Array.isArray(v) ? 'array' : typeof(v);
}
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment