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
  • 19,701
  • 13
  • 88
  • 127

0 Answers0