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

223
Views
JavaScript no puede establecer la propiedad '0' de indefinido (matriz bidimensional)

Sé que mucha gente ya ha preguntado esto, pero nada de lo que he intentado ha funcionado. He estado atrapado durante días.

Sospecho que puede deberse a que lo que estoy usando (code.org) es un montón de basura en llamas y usa ES5. Sin embargo, si nota algo malo, ¡hágamelo saber!

 function Vector2(x, y) { this.x = x; this.y = y; return this; } function Pixel(x, y, darkness) { this.position = Vector2(x, y); this.darkness = darkness; this.rgbDarkness = this.darkness * 255; return this; } function DataTexture2D(offsetX, offsetY, width, height) { this.offset = Vector2(offsetX, offsetY); this.size = Vector2(width, height); this.pixels = []; for (var x = 0; x < width; x++) { this.pixels[x] = []; for (var y = 0; y < height; y++) { this.pixels[x][y] = Pixel(x + this.offset.x, y + this.offset.y, 0.5); } } return this; } var test = DataTexture2D(100, 50, 200, 300); console.log(test.offset.x);

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!