I know that the below code clears the canvas
canvas.width = canvas.width
But how does this work internally?
Assignment operator just assign some value to variable, but how does this above code clear the canvas?
As per JavaScript rules. Assignment operator works just to assign value to some variable.
But Is there any way to call some other function by just assigning value to variable?