const i = [1 || 2]
if (!message.channel.name.includes(o['opts' i].identity.username.toLowerCase())) return message.channel.send('do commands only at <#bot-commands-id>');
console.log('oke');
如何為變數分配多個值?
const i = [1 || 2 || 3 || 4 || 5]
作為
uj5u.com熱心網友回復:
您只需要使用一個陣列,然后使用 i[index] 使用 for 回圈訪問所有索引來執行您的條件。
你的情況是:
const i = [1 ,2 ];
for (let j = 0 , j <= i.length , j ) {
if (!message.channel.name.includes(o['opts' i[j]].identity.username.toLowerCase())) return message.channel.send('do commands only at <#bot-commands-id>');
console.log('oke');
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/469294.html
標籤:javascript 节点.js 变量
