KEMBAR78
JavaScript objects and functions | PDF
JAVASCRIPT 
OBJECTS & FUNCTIONS 
Victor Perez
/ INTRODUCTION
OBJECTS ⁄ 
INTRODUCING 
● string, number, boolean, null and undefined 
● Wrapper objects: String, Number and Boolean 
● Object, Function, Boolean, Error, EvalError, RangeError, ReferenceError, SyntaxError, 
TypeError, URIError, Number, Math, Date, String, RegExp, Array and JSON 
● Host objects 
● no class inheritance 
● prototype inheritance
FUNCTIONS ⁄ 
INTRODUCING 
● Objects 
● Function scope 
● this and arguments 
● constructor 
● prototype 
● return ( default: undefined )
/ OBJECTS
CREATE ⁄ 
OBJECTS 
● literal 
● constructor 
● Object.create
CONSTRUCTOR ⁄ 
OBJECTS 
● Object.constructor
/ PROTOTYPE
INTRODUCTION ⁄ 
PROTOTYPE 
● Inheritance 
● Any object 
● Prototype chain 
● Read inheritance 
● Write own property
⁄ EXAMPLE PROTOTYPE
⁄ EXAMPLE PROTOTYPE
PROTOTYPE ⁄ 
OBJECTS 
● Object.create
PROTOTYPE ⁄ 
OBJECTS 
● Object constructor
/ FUNCTIONS
STATEMENT ⁄ 
FUNCTIONS 
● function statement
EXPRESSION ⁄ 
FUNCTIONS 
● function expression 
● The name is only available inside the 
function
CONSTRUCTOR ⁄ 
FUNCTIONS 
● Function constructor 
○ eval 
○ global scope
/ THIS
THIS 
⁄ GLOBAL CONTEXT 
● Global object 
● window in the browser
THIS 
⁄ FUNCTION CONTEXT 
● non strict 
○ Global object 
● strict mode 
○ undefined
⁄ OBJECT METHOD THIS 
● Object of the method
⁄ CONSTRUCTOR THIS 
● Object of the new created object
⁄ CALL & APPLY THIS 
● First parameter will be bound to this 
● call 
● apply 
● convert it to an object
⁄ BIND THIS 
● returns the same function where this is the same as the first parameter 
● this can’t be changed
/ JAVASCRIPT
/ QUESTIONS?
THANKS

JavaScript objects and functions