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

264
Views
Node.js TypeError: no se puede leer la propiedad '1' de undefined

índice.js

 const o = require('./altoken') for(const i=1; i<99; i++){ if(o.opts[i].identity.username === null){break;}; //error here message.guild.channels.create(o.opts[i].identity.username, {type: "text",parent: id}) }

altoken.js

 module.exports.opts1 = { mro: { as: false, }, identity: { username: "x", password: "x" }, krlo: [ 'x', ] };

Quiero crear tantos canales como módulos en altoken.js pero recibo un error. TypeError: no se puede leer la propiedad '1' de indefinido

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

0

Desea acceder a una propiedad por nombre de propiedad dinámica. Necesita notación de corchetes:

 o['opts' + i]

Ejemplo:

 const o = require('./altoken') for(const i=1; i<99; i++){ if(o['opts' + i].identity.username === null){break;}; //error here message.guild.channels.create(o['opts' + i].identity.username, {type: "text",parent: id}) }
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!