I am trying to set an array element as a Property object
A simplified example:
var array = ['a', 'b', 'c']; var obj = { array[1]: 'good' }
The above error.
Update: In fact, I am passing the object as part of another array, i.e. A simplified example would be:
aObj[value] = ['one', {array[1]: 'good'}, 'two', 'three', 'four'];
Style Setting obj[array[1]] = 'good'; means use
aObj[value][1][array[1]] = 'good';
source share