Last active
March 8, 2018 13:29
-
-
Save OmisNomis/7890b09de087a39d831b2c7049dbed39 to your computer and use it in GitHub Desktop.
Multi-dimensional Object
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
// Given this Object | |
const obj1 = { | |
one: 1, | |
two: 2, | |
three: { four: 4, five: { six: 6 } }, | |
seven: 7, | |
eight: { nine: 9, ten: 10 }, | |
eleven: { twelve: { thirteen: { fourteen: 14 } } }, | |
}; | |
// It should return a one dimensional Object, with all of the nested key-value pairs | |
{ one: 1, two: 2, four: 4, six: 6, seven: 7, nine: 9, ten: 10, fourteen: 14 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment