<canvas width = "600" height = "400"></canvas>
<script>
function desenhaQuadrado(x){
var tela = document.querySelector("canvas");
var pincel = tela.getContext("2d");
pincel.fillStyle = "green";
pincel.fillRect(x * 50,0,50,50);
pincel.fillStroke = "black";
pincel.strokeRect(x * 50,0,50,50);
}
for(var x = 0; x < 10; x++){
for(var y = 0; y < 10; y++){
desenhaQuadrado(y);
}
}
</script>