<meta charset="utf-8">
<canvas width="600" height="400"> </canvas>
<script type="text/javascript">
function desenhaQuadrado(){
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = "green";
pincel.fillRect(0,0,50,50);
pincel.strokeStyle = "red";
pincel.fillStroke = "red";
pincel.strokeRect(0,0,50,50);
}
desenhaQuadrado(0,0);
</script>