0
why the runtime error? how to define function context?
1 Answer
+ 3
// Fix your coding errors
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
window.onload = () => {
context.moveTo(0,0);
context.lineTo(600,400);
context.stroke();
}