5. Object as Literal
Object literal is an expression
It creates new object each time it
appears in the code
A single object literal can create
many objects in loop
6. Object using new operator
new operator creates a new
object
new operator initialize created
object also
new operator invokes a function
as give in above code snippet.
Function invoked after new
operator is Constructor
9. Nested Functions
Nested function can access variable
of parent function
Parent function cannot access
variable of nested function
You cannot call nestedfunction
from anywhere but the function it
is nested within.
12. Function Invocation Pattern
When you call a function as an
expression then it is known as
Function Invocation Pattern
First each parameter gets
evaluated and then being passed
as argument to function
Function return either value or
undefined to LHS variable .If
called function does not have any
return value then it returns
undefined
13. Method Invocation Pattern
Function which is part of an
object is known as Method
Invocation of method is known as
Method Invocation Pattern
A method can access its parent
object with this operator
Binding of method to object
happens on execution of method
15. Revealing Prototype Pattern
This is normally we implement it ,
It is hard to maintain when
functionality grows
It is hard to debug
It is hard to test
16. Revealing Prototype Pattern
Code is reusable
Functions can be overridden by
prototyping
There are no variables or functions
in global namespace
Functions are loaded into memory
only once