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

137
Views
La mejor manera de depurar javascript mientras no hay un mensaje de error para leer un campo no existente de un objeto
const ball = { x: canvas.width / 2, y: canvas.height / 2, size: 10, speed: 4, dx: 4, dy: -4 } // draw ball on canvas function drawBall() { ctx.beginPath(); ctx.arc(ball.x, ball.y, ball.xize, 0, Math.PI * 2); ctx.fillStyle = '#0095dd'; ctx.fill(); ctx.closePath(); }

Estoy tratando de dibujar una pelota usando un lienzo.

 ctx.arc(ball.x, ball.y, ball.xize, 0, Math.PI * 2);

Esta línea llama a arc() e intenta leer ball.size accediendo a ball.xize . Es un error tipográfico.
En los idiomas con los que estoy familiarizado, los errores tipográficos como este generan mensajes de error que pueden ayudar a identificar rápidamente la causa. No hay ninguno con javascript. ¿Cuál es la forma canónica de depurar javascript en tales casos? ¿Tenemos que leer y verificar todas y cada una de las líneas como lo hice aquí?

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!