var expertise = \'journalism\' var person = { name: \'Sharon\', age: 27, [expertise]: { years: 5, interests: [\'international\', \'politics\'
It is Computed property (ES2015) :
This is a sample:
var prop = 'foo'; var o = { [prop]: 'hey', ['b' + 'ar']: 'there' };
and you may use :
console.log(o.foo) // hey console.log(o.bar) // there