Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

referencing an array value in object key js

// use square bracket to wrap the array/object reference
let myObj = {
  [myArr[0]]: 'Value'
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #referencing #array #object #key #js
ADD COMMENT
Topic
Name
2+7 =