💾drawOnCanvas2D()
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
browser ⟩ canvas ⟩ drawOnCanvas2D()
💾 replit: square & circle
// ⭐ draw on <canvas> 2D context
function drawOnCanvas2D(selector, draw) {
let canvas = document.querySelector(selector);
if (!canvas) { console.log(`⛔ no such element: "${selector}"`); return; }