I think you need to ask someone more familiar with Javascript because I have just tried p5js mode (for the first time) and I am not getting any syntax errors with your original code of with my amended code.
1 Like