Re: Project>Square- Where do the number of arguments come from in these methods calls?
generates the following output
call Square.draw 1
Where does this one come from, when there is no expression inside draw() ? Is it due to 'this' ?
You are correct. Methods always get 'this' as argument 0.
The syntax of the function call determines what type of subroutine is being called, and what is passed as 'this':
method call -- only valid from within a method or constructor; passes current 'this' as 'this' argument.
method call -- passes object as 'this' argument.
function or constructor call -- there is no 'this' argument.