forked from MrOrz/webdev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs.note
More file actions
37 lines (23 loc) · 877 Bytes
/
Copy pathjs.note
File metadata and controls
37 lines (23 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
4nd week: more JS
!SLIDE
Memory Leak
----
Scopes: C-style stack frame v.s. Javascript's environments
=> closures, containing environments even if containing function has returned.
Yes the memory DOES leak.
http://code.google.com/intl/zh-TW/chrome/devtools/docs/memory-analysis-101.html
http://dmitrysoshnikov.com/ecmascript/es5-chapter-3-2-lexical-environments-ecmascript-implementation/
!SLIDE
prototype
----
Prototypes: argumenting default data types. (controversial?)
Object as Array's prototype
for-in loop and && hasOwnProperty
Regular Expressions
----
jQuery Deferred objects
Function can have methods and members.
'this' keyword: function itself, blahblahblah. Important: within setTimeout! this -> (global)= window
Function.prototype.apply & call
Constructors. (not very useful because we use Backbone Models instead)
http://ejohn.org/apps/learn/