View
167
Download
0
Category
Preview:
Citation preview
JavaScript NewbieSteven
General Pattern
Module Pattern
this
Reference
General Pattern Function Declarations
function demo(){…}
var demo = function(){…};
1. Makes it easier to understand "functions as an object”.
2. It enforces good semicolon habits.
3. Doesn't have much of the baggage traditionally associated with functions and scope.
*antipattern
Module Pattern
this
Difference between JavaScript and Java
JavaScript Java
base prototype class
this dynamic static
this
A:(10,10) B:(20,20) C:(10,20) D:(20,10)
A:(10,30)
B:(20,30)
C:(20,10)
D:(10,20)
this
End
Stay hungry. Stay foolish.
–Steven Paul Jobs 1955-2011
Recommended