<canvas width="600" height="400"></canvas>
<script>
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = 'green';
pincel.fillRect(0, 0, 50, 50);
pincel.fillStroke = 'black';
pincel.strokeRect(0, 0, 50, 50);
pincel.fillStyle = 'red';
pincel.fillRect(50, 0, 50, 0);
//pincel.strokeRect(50, 0, 50, 50);
pincel.fillRect(100, 0, 50, 50);
pincel.strokeRect(100, 0, 50, 50);
</script>