JSFiddle - React, Tailwind, and code Playground
by liyuanqiu
JavaScript
const canvas = document.createElement('canvas');
canvas.width = 500;
canvas.height = 500;
const context = canvas.getContext('2d');
for (let i = 0; i < 500; i += 10) {
context.strokeStyle = 'blue';
context.beginPath();
context.moveTo(0, i);
context.lineTo(500, i);
context.stroke();
context.beginPath();
context.moveTo(i, 0);
context.lineTo(i, 500);
context.stroke();
}
document.body.appendChild(canvas);