javascript - What do square brackets around a property name in an object literal mean? -
i've been writing in js while , have not used form:
dist: { files: { [bpr + 'lib/monster.min.js']: ['<%= concat.dist.dest %>'] } } }
the
[]:[]
it works, have not used or seen before.
only es6. called "computed property names"
from mdn:
starting ecmascript 2015, object initializer syntax supports computed property names. allows put expression in brackets
[]
, computed property name.
Comments
Post a Comment