var canvasWidth = canvas.width - xPadding;
var canvasHeight = canvas.height - yPadding;
var bw = canvas.Width;
Why does bw become undefined when I try to use it?
var canvasWidth = canvas.width - xPadding;
var canvasHeight = canvas.height - yPadding;
var bw = canvas.Width;
Why does bw become undefined when I try to use it?
Width should be in lowercase.
And going forward if you are struck anywhere do log the object for a detailed list of variables with in it for you to access them .
For example,
You can console.log(canvas); and in the console TAB of developer option (F12 on most of the browsers) you can find all the variables. That way you can cross check.