DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
dynamic key in javascript object
var key = 'DYNAMIC_KEY', obj = { [key]: 'ES6!' }; console.log(obj); // > { 'DYNAMIC_KEY': 'ES6!' }
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#dynamic
#key
#javascript
#object
ADD COMMENT
Topic
COMMENT
Name
3+5 =
Submit