Coding Walkthrough #4: Collision freezes the project?
Video Description:
To go in more detail about 3:11:
Uncaught TypeError: Cannot read property '0' of undefined at brickCollision...
This gives us a lot of detailed information with how we're going to solve this problem
- The error is when the brickCollision() function is evaluated by the compiler
- Compiler is try to read a property
- Specifically, the complier is trying to read the property '0'
- someObject.0
- someObject.someProp[0]
The second option occurs at line 238 (3:54) in the brickCollision() function. It then continues on until all the brickarray.xPos[0] or brickarray.yPos[0] is corrected.