Created
February 15, 2022 05:17
-
-
Save gtchakama/633b061bcd5d8e5af1e0a4afbf62924f to your computer and use it in GitHub Desktop.
Converting Object to an Array
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
const zoo = { | |
lion: '๐ฆ', | |
panda: '๐ผ', | |
}; | |
Object.keys(zoo); | |
// ['lion', 'panda'] | |
Object.values(zoo); | |
// ['๐ฆ', '๐ผ'] | |
Object.entries(zoo); | |
// [ ['lion', '๐ฆ'], ['panda', '๐ผ'] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment