看到個寫法, 有點不解, 代碼如下let a = 'user'const actions = { 'test' () { console.log(444444) }, // 為什么能夠這么定義函數 [`${a}test2`] () { console.log(555555) },}為什么es6能夠這么定義函數, 加了中括號卻不是數組?
es6 對象的key值, 為什么能夠這么寫?
慕工程0101907
2018-12-07 16:18:06
