<canvas whidth="600" heingth="400"></canvas>
<script>
function desenhaQuadrado(x,y,cor){
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = cor;
pincel.fillRect(x, 0, 50, 50);
pincel.fillStroke = 'black';
pincel.strokeRect(x, 0, 50, 50);
}
for (var x=0; x < 150; x=x+50){
desenhaQuadrado(x ,50, 'green')
}
desenhaQuadrado(150,50,'white');
</script>