<meta charset="utf-8">
<title>CANVAS</title>
</head>
<body>
<canvas width = "500" height = "500"></canvas>
<script>
function dibujarCuadrado(x,y){
var lienzo = document.querySelector("canvas");
var pincel = lienzo.getContext("2d");
pincel.fillStyle =
"blue";
pincel.fillRect(x,y,100,100);
pincel.strokeStyle = "yellow";
pincel.strokeRect(x,y,100,100);
}
dibujarCuadrado(0,0);
dibujarCuadrado(100,0);
dibujarCuadrado(100,0);
</script>
</body>
</html>