Estou tentando desenhar o retangulo mas quando tento ele não desenha
HTML:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas</title>
<script src="script.js"></script>
</head>
<body>
<canvas id="tela" width="600" height="400"></canvas>
</body>
</html>
JS:
var tela = document.getElementById("tela")
var pincel = tela.getContext("2d")
pincel.fillStyle = "lightgrey"
pincel.fillRect(0,0,600,400)