Converting Processing to p5: Uncaught TypeError: Cannot read property 'length' of undefined

Hi Folks,

I am very new to coding (about 3-5 months). I'm trying to convert some Processing(Java) code to P5.js. The processing code has a Class in it, so I'm trying to use the prototype function approach to converting the code.

Mostly going fine accept when I'm trying to execute a for loop. I'm trying to use the length of a variable in my function in the loop, which works in the Processing sketch. However, the "Uncaught TypeError: Cannot read property 'length' of undefined" keeps popping up.

Can anyone help please? I'll attach a screen shot of the code.

Screen Shot 2017-08-10 at 9.34.10 pm

Answers

Sign In or Register to comment.