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

116
Views
Por qué este valor no cambia cuando la consola lo registra. Está mostrando 0 0
let roomLength = 0 let studentLength = 0 db.query("SELECT * FROM rooms", (err, result)=>{ if(err){ console.log(err); }else{ roomLength = result.length } }) db.query("SELECT * FROM student", (err, result)=>{ if(err){ console.log(err); }else{ studentLength = result.length } }) console.log(roomLength, studentLength)

StudentLength y roomLength se muestran como 0 0 cuando se registran fuera de la función db.query. Pero funciona bien al agregar console.log dentro de db.query

about 4 years ago · Juan Pablo Isaza
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!