Return an array of keys from an object Return an array of keys from an object. Pass in the object as an argument. var lunch = { sandwich: 'turkey', chips: 'cape cod', drink: 'soda' }; // logs ['sandwich', 'chips', 'drink'] var keys = Object.keys(lunch); console.log(keys); Source https://vanillajstoolkit.com/reference/objects/object-keys/