Skip to content

Instantly share code, notes, and snippets.

@eouw0o83hf
Last active July 21, 2018 13:03
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 eouw0o83hf/7fc1d90af5fc19286278021954d62933 to your computer and use it in GitHub Desktop.
Save eouw0o83hf/7fc1d90af5fc19286278021954d62933 to your computer and use it in GitHub Desktop.
Javascript to list all fields of an object and types of their instances
function listAllFields(target) {
var allFields = Object
.entries(targetObject)
.map(a => `${a[0]}: ${typeof(a[1])}`)
.join(', ');
console.log(allFields);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment