Skip to content

Instantly share code, notes, and snippets.

@rdeprey
Created April 1, 2019 23:59
Show Gist options
  • Save rdeprey/505390b782bde475f897bb9f75b7cf30 to your computer and use it in GitHub Desktop.
Save rdeprey/505390b782bde475f897bb9f75b7cf30 to your computer and use it in GitHub Desktop.
Get an array of an object's properties using the Object.keys() method
const taco = {
tortillaType: 'corn',
meat: 'chicken',
toppings: 'lettuce, cheese, tomatoes',
};
const tacoProperties = Object.keys(taco);
console.log(tacoProperties); // Expected output: ['tortillaType', 'meat', 'toppings']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment