Functions (and Methods)
JS Function vs Method:
Function:
Standalone, not attached to objects
Called directly by name:
calculateTotal()
Defined with function declaration or expression
Method:
Function attached to an object or class
Called through object reference:
object.doSomething()
this
keyword refers to the containing object
References
Last updated