For loop inside another for loop crashes in Javascript
问题 I want to randomly generate a color for each pixel in the canvas however my loop seems to crash the browser and I cannot figure out why? I have tried reducing the loop to a static number (X = 10 x Y=100) and it seems to work. However it takes a few seconds for the result to be shown on the screen (despite my tests showing a run time of 10ms) I am new to javascript/html so this could be an obvious solution, however any help is greatly appreciated. //"use strict"; // SELECT THE CANVAS ELEMENT