#Keys from variables in object literal
11 messages · Page 1 of 1 (latest)
Wrap the property name in []
Oh, thanks @lament stirrup !
Damn, I was brwosing all the docs I've found and havent found it mentioned
And you might shorten it to
const n = 'name'
const foo = {
[n]: 5
}
``` then
!resolved
:warning: Only the asker can change the status of a help post
!resolved
@ripe bear
Because your issue seemed to be resolved, this post was marked as resolved by @lament stirrup.
If your issue is not resolved, you can reopen this post by running !reopen.
If you have a different question, make a new post in #1057653400046674112.
Thanks again! ❤️
No problem