JSFiddle - React, Tailwind, and code Playground

by Hensixteen

HTML

<canvas id='canvas' width='200' height='200' style='border:1px solid #000000'></canvas>

JavaScript

var canvas = document.getElementById('canvas');
var ctx canvas.getContext('2d');
var x = 0;
var y = 200;

while (x<= 200 || y>=0) {
	ctx.moveTo(x,0);
  ctx.lineTo(y,200);
  ctx.stroke();
  x+=10
  y-=10
}