Created
January 13, 2018 14:41
-
-
Save tarrsalah/fccd5ef663b9a051ac99876c3a0afb1f to your computer and use it in GitHub Desktop.
Strange syntax to create an object in javascript
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
const stringArray = ["STRING_ARRAY"]; | |
const strangeObject = { | |
[stringArray]() { | |
console.log(stringArray); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment