I\'ve been writing in JS for a while and have not used this form:
dist: {
files: {
[bpr + \'lib/Monster.min.js\']: [\'<%= concat.dist.dest %>\']
}
}
}
the
[]:[]
it works, I just have not used it or seen it before.
I\'ve been writing in JS for a while and have not used this form:
dist: {
files: {
[bpr + \'lib/Monster.min.js\']: [\'<%= concat.dist.dest %>\']
}
}
}
the
[]:[]
it works, I just have not used it or seen it before.
Only recently with ES6. They are called \"computed property names\"
From MDN:
Starting with ECMAScript 2015, the object initializer syntax also supports computed property names. That allows you to put an expression in brackets
[]
, that will be computed as the property name.