Created
April 2, 2019 00:05
-
-
Save rdeprey/c6050b8dd8a21383d4a318cd46be8e89 to your computer and use it in GitHub Desktop.
Get a two-dimensional array of an object's key/value pairs using the Object.entries() method
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 taco = { | |
| tortillaType: 'corn', | |
| meat: 'chicken', | |
| toppings: 'lettuce, cheese, tomatoes', | |
| }; | |
| const tacoArr = Object.entries(taco); | |
| console.log(tacoArr); // Expected output: [['tortillaType', 'corn'], ['meat', 'chicken'], ['toppings', 'lettuce, cheese, tomatoes']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment