This question already has an answer here:
String Interpolation in an Object (1 answer)
Closed 16 hours ago.
I am doing some JS challenges and am a stuck on one of the questions, for some reason the function argument isn't available and its blank in VS code and getting some unexpected results.
function myFunction(a, b) {
return {a:b}
}
console.log(myFunction('b','w'))
//Expected result {b:'w'}
//What I am getting in console {a: 'w'}
1条答案
按热度按时间fumotvh31#
看起来您正在尝试动态设置密钥。请尝试此操作。