Making a random art generator for assignment. We are supposed to have squares randomly pop up but I can't figure out to draw a square. This is what I have so far
function drawSquare(canvas, context, color){
var x= Math.floor(Math.random()*canvas.width);
var y= Math.floor(Math.random()*canvas.height);
context.beginPath();
context.fillStyle = color;
context.fillRect (x,y, canvas.width, canvas.height)
}