How do I interpolate a variable as a key in a JavaScript object?

后端 未结 6 1494
渐次进展
渐次进展 2020-12-01 07:22

How can I use the value of the variable a as a key to lookup a property? I want to be able to say: b[\"whatever\"] and have this return 20:

6条回答
提交回复
热议问题