0

To declare an object where one of the keys is variable, you can do the following:

var obj={};
obj[variable]="foo";

Is they a more concise syntax ?

edi9999
  • 18,115
  • 12
  • 85
  • 125

0 Answers0