Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能完成这个任务:
var i = 'foo'; var x = { i: 'bar' } console.log(x); > {'foo':'bar'};
谢谢!
使用括号表示法:
var i = 'foo'; var x = {}; x[i] = 'bar';