Last active
September 27, 2019 11:10
-
-
Save leonardreidy/e92dcdc0c34f268499e4109cbc710c6e to your computer and use it in GitHub Desktop.
This file contains 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
let ob = { age: 41, name: 'Leonard', profession: 'JavaScript Developer' }; | |
let looped = [] | |
for(const key of Object.keys(ob)){ | |
looped.push({ [key]: ob[key] }) | |
} | |
console.log(looped) // logs [{ age: 41 }, { name: 'Leonard' }, { profession: 'JavaScript Developer' }] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment