Skip to content

Instantly share code, notes, and snippets.

@xemasiv
Last active March 8, 2018 18:16
Show Gist options
  • Save xemasiv/7efac39584a9f5ef0a48a7e520f9f720 to your computer and use it in GitHub Desktop.
Save xemasiv/7efac39584a9f5ef0a48a7e520f9f720 to your computer and use it in GitHub Desktop.
Sample json object.
id value
flare
flare.analytics
flare.analytics.cluster
[
{"name": "Eve", "parent": ""},
{"name": "Cain", "parent": "Eve"},
{"name": "Seth", "parent": "Eve"},
{"name": "Enos", "parent": "Seth"},
{"name": "Noam", "parent": "Seth"},
{"name": "Abel", "parent": "Eve"},
{"name": "Awan", "parent": "Eve"},
{"name": "Enoch", "parent": "Awan"},
{"name": "Azura", "parent": "Eve"}
]
@xemasiv
Copy link
Author

xemasiv commented Mar 8, 2018

Object.keys(o) = array of object's keys / properties
Object.keys(o).length = integer
Using object instead of array keeps it simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment