Maybe I’m not using Math.random() correctly, although I can’t figure out what I’m doing wrong:
ctx.fillStyle = "rgb(Math.floor(Math.random()*256),Math.floor(Math.random()*256),Math.floor(Math.random()*256))";
ctx.fillRect(0,0,canvas.width,canvas.height);
fillStyle is a string. You need to use string concatenation to do what you want. Like this: