Created
April 4, 2018 01:58
-
-
Save Announcement/1697e5ba97c4a6330df5d5b067e6c697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function * getProperties (object) { | |
for (const [key, value] of Object.entries(object)) { | |
yield [key] | |
if (typeof value === 'object') | |
for (const each of getProperties(value)) | |
yield [key, ...each] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment