SyntaxFix
Write A Post
Hire A Developer
Questions
ES6 introduces computed property names, which allow you to do
var myObj = {[a]: b};
Note browser support is currently negligible.