這是交易
if(!userExist) {
userJson["user"] = [{"name": msg.author.username, "commands": { userCommand : userCommandValue }}]
}
編輯: 為避免混淆,這是我的 userCommand :
讓 userCommand = msg.content;
userCommand被認為是一個屬性,而不是一個現有的變數......
有沒有辦法繞過它?
uj5u.com熱心網友回復:
從 ES6 開始,您可以這樣做:包裝[]arountuserCommand
if(!userExist) {
userJson["user"] = [{"name": msg.author.username, "commands": { [userCommand] : userCommandValue }}]
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/379926.html
標籤:javascript 节点.js json
