Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
Assigning Multiple Values ​to a Variable in Node.js
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');

How can I assign multiple values ​​to variable?

const i = [1 || 2 || 3 || 4 || 5]

as

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You just have to Use an array , and you do your condition with i[index] accessing all indexs with a for loop.

In your case is :

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');
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!