Skip to content

Instantly share code, notes, and snippets.

@leonardreidy
Last active September 27, 2019 11:09
Show Gist options
  • Save leonardreidy/0ccfcc8502a6c6c6e71061e5ea2d1a82 to your computer and use it in GitHub Desktop.
Save leonardreidy/0ccfcc8502a6c6c6e71061e5ea2d1a82 to your computer and use it in GitHub Desktop.
let ob = { age: 41, name: 'Leonard', profession: 'JavaScript Developer' };
let properties = Object.keys(ob).map((key) => {
return { [key]: ob[key] }
}); // returns [ { 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