> a = 'k'
'k'
> {[a]: 1}
{ k: 1 }
这段代码是在babel-node里面跑的,查遍了文档也没有找到(文档里面肯定有)
> a = 'k'
'k'
> {[a]: 1}
{ k: 1 }
这段代码是在babel-node里面跑的,查遍了文档也没有找到(文档里面肯定有)
1
gxm44 Mar 2, 2016 These are called "computed property names".
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Computed_property_names |
2
djyde Mar 2, 2016 |
3
agate Mar 2, 2016
楼上正解~
|