HTML Canvas is an HTML element used for graphics to draw shapes. We can define canvas in HTML like any other element and then modify that or use that in JS
We have 2 different APIs in JS that allows us to draw on the canvas element
/*index.js*/constcanvas=document.getElementById('canvas1') // for JS Intellisense use below line constcanvas=/** @type{HTMLCanvasElement} */ (document.querySelector('#canvas1'))// canvas API 2Dconstctx=canvas.getContext('2d')// canvas API 3D// const ctx = canvas.getContext('webgl')console.log(ctx)ctx.beginPath() // imagine, putting pencil on paper before drawing