javascript: the good parts for humans (part 3)
DESCRIPTION
Javascript - this property, arguments propertyTRANSCRIPT
![Page 1: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/1.jpg)
JavaScriptThe good parts for humans
(part 3)
B Anjaneyulu ReddyEmail: [email protected]
Twitter: @_anjiwww.evibe.in
![Page 2: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/2.jpg)
Agenda
Day 2 revisit
this property
arguments property
![Page 3: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/3.jpg)
Method invocation pattern
method: function stored as a property
this - object containing method
late binding
Sample 1
![Page 4: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/4.jpg)
Function invocation pattern
this - global object [design mistake]
inner functions this: refers to global object
var that = this
Sample 2
![Page 5: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/5.jpg)
Constructor invocation pattern
functions invoked with new prefix
this - new object created
no explicit return value - this is returned
hidden link to function's prototype
Sample 3
![Page 6: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/6.jpg)
Apply invocation pattern
apply method• two parameters
o value for thiso array of parameters
this - first parameter of apply
Sample 4
![Page 7: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/7.jpg)
Questions?
![Page 8: Javascript: The good parts for humans (part 3)](https://reader036.vdocuments.mx/reader036/viewer/2022082704/55878411d8b42a847d8b4641/html5/thumbnails/8.jpg)
Thank You