SlideShare a Scribd company logo
Object Oriented JavaScript
An Introduction
Gaurav Gupta
Agenda
●
JavaScript: What & Why ?
●
Javascript Basics keywords and Syntax
●
Functions
●
Special Functions: bind, call and apply, setTimeout, setInterval function.
●
Objects: Working with Objects
●
What is “this” ?
●
Prototypal Inheritance
●
Callbacks & Callback Hell
●
Closures & Promises
●
Async Programming
What???
● JavaScript is the most popular scripting language on the
internet, and works in all major browsers, such as Internet
Explorer, Firefox, Chrome, Opera, and Safari.
What and Why is JavaScript??
● JavaScript was designed to add interactivity to HTML pages
● JavaScript is a scripting language
● JavaScript is usually embedded directly into HTML pages
● JavaScript is an interpreted language (means that scripts execute
without preliminary compilation)
● Everyone can use JavaScript without purchasing a license
Document.write()
● It is used to write text on the document.
● Example:
● <html>
● <body>
● <h1>My First Web Page</h1>
● <script type="text/javascript">
● document.write("<p>" + Date() + "</p>");
● </script>
● </body>
● </html>
JavaScript Variables
● Same as algebra, JavaScript variables are used to hold
values or expressions.
● A variable can have a short name, like x, or a more
descriptive name, like carname.
● Rules for JavaScript variable names:
● Variable names are case sensitive (y and Y are two
different variables)
● Variable names must begin with a letter or the
underscore character
● Note: Because JavaScript is case-sensitive, variable names
are case-sensitive.
Example
var x=5;
var carname="Volvo";
y=x-5;
z=y+5;
Etc..
JavaScript Operators
JavaScript Comparators
JavaScript If...Else Statements
● Javascript supports if,if else, else statements.
● <script type="text/javascript">
● //If the time is less than 10, you will get a "Good morning" greeting.
● //Otherwise you will get a "Good day" greeting.
● var d = new Date();
● var time = d.getHours();
● if (time < 10)
● {
● document.write("Good morning!");
● }
● else
● {
● document.write("Good day!");
● }
● </script>
JavaScript Switch Statement
● JavaScript Supports Switch Statement
<script type="text/javascript">
● //You will receive a different greeting based
● //on what day it is. Note that Sunday=0,
● //Monday=1, Tuesday=2, etc.
● var d=new Date();
● var theDay=d.getDay();
● switch (theDay){
● Case 5: document.write("Finally Friday");
● break;
● Case 6: document.write("Super Saturday");
● break;
● Case 0: document.write("Sleepy Sunday");
● break;
● Default: document.write("I'm looking forward to this weekend!");
● }
● </script>
JavaScript Popup Boxes
● Three types of boxes:
– Alert Box
● alert("sometext");
– Prompt Box
● var name = prompt("Please enter your name","Harry
Potter");
– Confirm Box
● var r = confirm("Press a button"); return: [true/false]
Functions
●
Functions are first class members of JavaScript
●
They can be used just like variables
function someFunction(arg1, arg2) {
return arg1 + arg2;
}
Functions
●
Functions are first class members of JavaScript
●
They can be used just like variables
function someFunction(arg1, arg2) {
return arg1 + arg2;
}
Objects
●
In JavaScript almost everything is an Object
●
Multiple ways to create an Object
○
Object Constructor var obj = new Object()
○
Object Literal var obj = {}
○
Inbuilt Method var obj = Object.create()
○
Constructor function var obj = new Person()
Exampl
e
Constructor Function
●
Constructor function is similar to the notation of a
Class
function Person(name, age) {
this.name = name;
this.age = age;
}
Exampl
e
Prototypes
●
Objects inheriting from other Objects
●
Prototype is an object used to construct new
objects
●
we can assign properties to prototypes to inherit
them
Prototypes are used with Constructor Functions
Prototypal Chain
●
All Objects inherit from Object class
●
If certain property is not available on current
object, it is looked on prototype, then Parent’s
prototype and so on … until the property or
null is found
o → o.prototype …→ → Object.prototype → null
Inheritance
●
Inheriting properties and methods
●
Prototypes are used for inheritance
●
Two ways
○
Inherit from Constructor Functions (Class)
○
Inherit from another Objects
Exampl
e
Call & Apply
●
Call/Apply both are used to call a function with the
ability to change the this reference
●
Only difference between the two is syntax
○
Call takes arguments as a list
functionName.call(obj, arg1, arg2);
○
Apply takes an array of Arguments
functionName.apply(obj, [arg1, arg2]);
Exampl
e
Callbacks
●
Callbacks are basically functions passed on as
arguments to another operation
●
This allows us to cope with Asynchronous nature
of JavaScript
●
We don’t have to block the browser for results
Exampl
e
Async Programming
●
Callbacks really help in maintaining the sanity in
Asynchronous operations
●
But, what if there are huge no of async operations
depending on each other, nested inside each
other..
●
This is referred to as Callback hell..
Callback Hell
asyncOp1(function(result) {
asyncOp2(function(result1) {
asyncOp3(function(result2) {
...
asyncOp1476(function(result3) {
//phew! got my result
});
});
});
});
Async Flow Control
●
Callback hell can be avoided by controlling the
program flow
●
Async.JS is an excellent library to control the
callback flow
●
Promises Pattern can be very useful with Async
Operations
Async Flow Control
●
Callback hell can be avoided by controlling the
program flow
●
Async.JS is an excellent library to control the
callback flow
●
Promises Pattern can be very useful with Async
Operations
Tips & Tricks
●
use + to convert expressions to a number
○
+new Date() gives Timestamp
●
use !! to convert any expression to a boolean
●
Append array to another array
○
a = [1,2,3]; b= [4,5,6]
○
Array.prototype.push.apply(a,b)
Exercises
●
Add a loop() method to the Prototype of Array
●
Implement basic Inheritance with an example of
Employee
●
print numbers 1..5, such that every number is
printed after 500ms
Thank You !
Gaurav Gupta

More Related Content

PPTX
Object Oriented Programming In JavaScript
Forziatech
 
PPT
Introduction to Javascript
Amit Tyagi
 
PPT
Javascript
mussawir20
 
PPTX
Lab #2: Introduction to Javascript
Walid Ashraf
 
PPTX
Angular js PPT
Imtiyaz Ahmad Khan
 
PPTX
Javascript functions
Alaref Abushaala
 
PPTX
React js
Oswald Campesato
 
Object Oriented Programming In JavaScript
Forziatech
 
Introduction to Javascript
Amit Tyagi
 
Javascript
mussawir20
 
Lab #2: Introduction to Javascript
Walid Ashraf
 
Angular js PPT
Imtiyaz Ahmad Khan
 
Javascript functions
Alaref Abushaala
 

What's hot (20)

PDF
Basics of JavaScript
Bala Narayanan
 
PDF
jQuery for beginners
Arulmurugan Rajaraman
 
PDF
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
PPT
JavaScript Variables
Charles Russell
 
PPTX
Introducing type script
Remo Jansen
 
PPTX
Introduction to Node.js
Vikash Singh
 
PPTX
Javascript 101
Shlomi Komemi
 
PPTX
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
PPT
Js ppt
Rakhi Thota
 
PPT
JavaScript - Part-1
Jainul Musani
 
PPTX
Java features
Prashant Gajendra
 
PDF
Asynchronous JavaScript Programming
Haim Michael
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
PDF
javascript objects
Vijay Kalyan
 
PPT
TypeScript Presentation
Patrick John Pacaña
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
PPT
Advanced Javascript
Adieu
 
PPT
JavaScript Tutorial
Bui Kiet
 
PDF
JavaScript Programming
Sehwan Noh
 
Basics of JavaScript
Bala Narayanan
 
jQuery for beginners
Arulmurugan Rajaraman
 
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
JavaScript - An Introduction
Manvendra Singh
 
JavaScript Variables
Charles Russell
 
Introducing type script
Remo Jansen
 
Introduction to Node.js
Vikash Singh
 
Javascript 101
Shlomi Komemi
 
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Js ppt
Rakhi Thota
 
JavaScript - Part-1
Jainul Musani
 
Java features
Prashant Gajendra
 
Asynchronous JavaScript Programming
Haim Michael
 
ReactJS presentation.pptx
DivyanshGupta922023
 
javascript objects
Vijay Kalyan
 
TypeScript Presentation
Patrick John Pacaña
 
TypeScript - An Introduction
NexThoughts Technologies
 
Advanced Javascript
Adieu
 
JavaScript Tutorial
Bui Kiet
 
JavaScript Programming
Sehwan Noh
 
Ad

Viewers also liked (20)

PPTX
Bringbestoinyou
Dhananjay Kumar
 
PPTX
Functions and Objects in JavaScript
Dhananjay Kumar
 
PDF
this
偉格 高
 
PPTX
Javascript - Array - Writing
Samuel Santos
 
PPT
Strings
Max Friel
 
PDF
Javascript good parts - for novice programmers
Manohar Shetty
 
PDF
Datatype
baran19901990
 
PPT
Javascript by geetanjali
Geetanjali Bhosale
 
PPT
Tree and Binary Search tree
Muhazzab Chouhadry
 
PPTX
Javascript - Array - Creating Array
Samuel Santos
 
PDF
Learn REST in 18 Slides
Suraj Gupta
 
PDF
The JavaScript You Wished You Knew
Troy Miles
 
PDF
Good Parts of JavaScript Douglas Crockford
rajivmordani
 
PDF
JavaScript - From Birth To Closure
Robert Nyman
 
PPTX
Structure of url, uniform resource locator
Partnered Health
 
PDF
JavaScript Functions
Colin DeCarlo
 
PPTX
Javascript para principiantes -Introducción
Oscar Josué Uh Pérez
 
PDF
Introduction to JSON
Kanda Runapongsa Saikaew
 
PPTX
Basics of computer science
Paul Schmidt
 
PPTX
JSON: The Basics
Jeff Fox
 
Bringbestoinyou
Dhananjay Kumar
 
Functions and Objects in JavaScript
Dhananjay Kumar
 
Javascript - Array - Writing
Samuel Santos
 
Strings
Max Friel
 
Javascript good parts - for novice programmers
Manohar Shetty
 
Datatype
baran19901990
 
Javascript by geetanjali
Geetanjali Bhosale
 
Tree and Binary Search tree
Muhazzab Chouhadry
 
Javascript - Array - Creating Array
Samuel Santos
 
Learn REST in 18 Slides
Suraj Gupta
 
The JavaScript You Wished You Knew
Troy Miles
 
Good Parts of JavaScript Douglas Crockford
rajivmordani
 
JavaScript - From Birth To Closure
Robert Nyman
 
Structure of url, uniform resource locator
Partnered Health
 
JavaScript Functions
Colin DeCarlo
 
Javascript para principiantes -Introducción
Oscar Josué Uh Pérez
 
Introduction to JSON
Kanda Runapongsa Saikaew
 
Basics of computer science
Paul Schmidt
 
JSON: The Basics
Jeff Fox
 
Ad

Similar to Object Oriented Javascript (20)

PPTX
An introduction to Object Oriented JavaScript
TO THE NEW | Technology
 
ODP
Introduction of Object Oriented JavaScript
NexThoughts Technologies
 
PDF
8 introduction to_java_script
Vijay Kalyan
 
PPTX
Learn TypeScript from scratch
Mohd Manzoor Ahmed
 
PDF
Introduction to Object Oriented Javascript
nodeninjas
 
ODP
Javascript training sample
prahalad_das_in
 
PDF
HelsinkiJS - Clojurescript for Javascript Developers
Juho Teperi
 
PDF
JavaScript - Chapter 7 - Advanced Functions
WebStackAcademy
 
PDF
Node.js Course 1 of 2 - Introduction and first steps
Manuel Eusebio de Paz Carmona
 
PDF
Dart workshop
Vishnu Suresh
 
PDF
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
PDF
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
PPTX
JavaScript | Introduction
Velimir Bulatovic
 
PPTX
Journey through high performance django application
bangaloredjangousergroup
 
PDF
Dragoncraft Architectural Overview
jessesanford
 
PDF
JavaScript From Hell - CONFidence 2.0 2009
Mario Heiderich
 
PPTX
Lecture 5: Client Side Programming 1
Artificial Intelligence Institute at UofSC
 
PDF
Spock pres
elizhender
 
PPTX
The JavaScript Event Loop - Concurrency in the Language of the Web
marukochan23
 
PPTX
Dart the Better JavaScript
Jorg Janke
 
An introduction to Object Oriented JavaScript
TO THE NEW | Technology
 
Introduction of Object Oriented JavaScript
NexThoughts Technologies
 
8 introduction to_java_script
Vijay Kalyan
 
Learn TypeScript from scratch
Mohd Manzoor Ahmed
 
Introduction to Object Oriented Javascript
nodeninjas
 
Javascript training sample
prahalad_das_in
 
HelsinkiJS - Clojurescript for Javascript Developers
Juho Teperi
 
JavaScript - Chapter 7 - Advanced Functions
WebStackAcademy
 
Node.js Course 1 of 2 - Introduction and first steps
Manuel Eusebio de Paz Carmona
 
Dart workshop
Vishnu Suresh
 
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
 
JavaScript | Introduction
Velimir Bulatovic
 
Journey through high performance django application
bangaloredjangousergroup
 
Dragoncraft Architectural Overview
jessesanford
 
JavaScript From Hell - CONFidence 2.0 2009
Mario Heiderich
 
Lecture 5: Client Side Programming 1
Artificial Intelligence Institute at UofSC
 
Spock pres
elizhender
 
The JavaScript Event Loop - Concurrency in the Language of the Web
marukochan23
 
Dart the Better JavaScript
Jorg Janke
 

More from NexThoughts Technologies (20)

PDF
Alexa skill
NexThoughts Technologies
 
PDF
Docker & kubernetes
NexThoughts Technologies
 
PDF
Apache commons
NexThoughts Technologies
 
PDF
Microservice Architecture using Spring Boot with React & Redux
NexThoughts Technologies
 
PDF
Solid Principles
NexThoughts Technologies
 
PDF
Introduction to TypeScript
NexThoughts Technologies
 
PDF
Smart Contract samples
NexThoughts Technologies
 
PDF
My Doc of geth
NexThoughts Technologies
 
PDF
Geth important commands
NexThoughts Technologies
 
PDF
Ethereum genesis
NexThoughts Technologies
 
PPTX
Springboot Microservices
NexThoughts Technologies
 
PDF
An Introduction to Redux
NexThoughts Technologies
 
PPTX
Google authentication
NexThoughts Technologies
 
Docker & kubernetes
NexThoughts Technologies
 
Apache commons
NexThoughts Technologies
 
Microservice Architecture using Spring Boot with React & Redux
NexThoughts Technologies
 
Solid Principles
NexThoughts Technologies
 
Introduction to TypeScript
NexThoughts Technologies
 
Smart Contract samples
NexThoughts Technologies
 
My Doc of geth
NexThoughts Technologies
 
Geth important commands
NexThoughts Technologies
 
Ethereum genesis
NexThoughts Technologies
 
Springboot Microservices
NexThoughts Technologies
 
An Introduction to Redux
NexThoughts Technologies
 
Google authentication
NexThoughts Technologies
 

Recently uploaded (20)

PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Hyogeun Oh
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPTX
Color Model in Textile ( RGB, CMYK).pptx
auladhossain191
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PPTX
unit 3a.pptx material management. Chapter of operational management
atisht0104
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PPT
Lecture in network security and mobile computing
AbdullahOmar704132
 
PPTX
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Hyogeun Oh
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Software Testing Tools - names and explanation
shruti533256
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
Color Model in Textile ( RGB, CMYK).pptx
auladhossain191
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
unit 3a.pptx material management. Chapter of operational management
atisht0104
 
Information Retrieval and Extraction - Module 7
premSankar19
 
Lecture in network security and mobile computing
AbdullahOmar704132
 
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 

Object Oriented Javascript

  • 1. Object Oriented JavaScript An Introduction Gaurav Gupta
  • 2. Agenda ● JavaScript: What & Why ? ● Javascript Basics keywords and Syntax ● Functions ● Special Functions: bind, call and apply, setTimeout, setInterval function. ● Objects: Working with Objects ● What is “this” ? ● Prototypal Inheritance ● Callbacks & Callback Hell ● Closures & Promises ● Async Programming
  • 3. What??? ● JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari.
  • 4. What and Why is JavaScript?? ● JavaScript was designed to add interactivity to HTML pages ● JavaScript is a scripting language ● JavaScript is usually embedded directly into HTML pages ● JavaScript is an interpreted language (means that scripts execute without preliminary compilation) ● Everyone can use JavaScript without purchasing a license
  • 5. Document.write() ● It is used to write text on the document. ● Example: ● <html> ● <body> ● <h1>My First Web Page</h1> ● <script type="text/javascript"> ● document.write("<p>" + Date() + "</p>"); ● </script> ● </body> ● </html>
  • 6. JavaScript Variables ● Same as algebra, JavaScript variables are used to hold values or expressions. ● A variable can have a short name, like x, or a more descriptive name, like carname. ● Rules for JavaScript variable names: ● Variable names are case sensitive (y and Y are two different variables) ● Variable names must begin with a letter or the underscore character ● Note: Because JavaScript is case-sensitive, variable names are case-sensitive.
  • 10. JavaScript If...Else Statements ● Javascript supports if,if else, else statements. ● <script type="text/javascript"> ● //If the time is less than 10, you will get a "Good morning" greeting. ● //Otherwise you will get a "Good day" greeting. ● var d = new Date(); ● var time = d.getHours(); ● if (time < 10) ● { ● document.write("Good morning!"); ● } ● else ● { ● document.write("Good day!"); ● } ● </script>
  • 11. JavaScript Switch Statement ● JavaScript Supports Switch Statement <script type="text/javascript"> ● //You will receive a different greeting based ● //on what day it is. Note that Sunday=0, ● //Monday=1, Tuesday=2, etc. ● var d=new Date(); ● var theDay=d.getDay(); ● switch (theDay){ ● Case 5: document.write("Finally Friday"); ● break; ● Case 6: document.write("Super Saturday"); ● break; ● Case 0: document.write("Sleepy Sunday"); ● break; ● Default: document.write("I'm looking forward to this weekend!"); ● } ● </script>
  • 12. JavaScript Popup Boxes ● Three types of boxes: – Alert Box ● alert("sometext"); – Prompt Box ● var name = prompt("Please enter your name","Harry Potter"); – Confirm Box ● var r = confirm("Press a button"); return: [true/false]
  • 13. Functions ● Functions are first class members of JavaScript ● They can be used just like variables function someFunction(arg1, arg2) { return arg1 + arg2; }
  • 14. Functions ● Functions are first class members of JavaScript ● They can be used just like variables function someFunction(arg1, arg2) { return arg1 + arg2; }
  • 15. Objects ● In JavaScript almost everything is an Object ● Multiple ways to create an Object ○ Object Constructor var obj = new Object() ○ Object Literal var obj = {} ○ Inbuilt Method var obj = Object.create() ○ Constructor function var obj = new Person() Exampl e
  • 16. Constructor Function ● Constructor function is similar to the notation of a Class function Person(name, age) { this.name = name; this.age = age; } Exampl e
  • 17. Prototypes ● Objects inheriting from other Objects ● Prototype is an object used to construct new objects ● we can assign properties to prototypes to inherit them Prototypes are used with Constructor Functions
  • 18. Prototypal Chain ● All Objects inherit from Object class ● If certain property is not available on current object, it is looked on prototype, then Parent’s prototype and so on … until the property or null is found o → o.prototype …→ → Object.prototype → null
  • 19. Inheritance ● Inheriting properties and methods ● Prototypes are used for inheritance ● Two ways ○ Inherit from Constructor Functions (Class) ○ Inherit from another Objects Exampl e
  • 20. Call & Apply ● Call/Apply both are used to call a function with the ability to change the this reference ● Only difference between the two is syntax ○ Call takes arguments as a list functionName.call(obj, arg1, arg2); ○ Apply takes an array of Arguments functionName.apply(obj, [arg1, arg2]); Exampl e
  • 21. Callbacks ● Callbacks are basically functions passed on as arguments to another operation ● This allows us to cope with Asynchronous nature of JavaScript ● We don’t have to block the browser for results Exampl e
  • 22. Async Programming ● Callbacks really help in maintaining the sanity in Asynchronous operations ● But, what if there are huge no of async operations depending on each other, nested inside each other.. ● This is referred to as Callback hell..
  • 23. Callback Hell asyncOp1(function(result) { asyncOp2(function(result1) { asyncOp3(function(result2) { ... asyncOp1476(function(result3) { //phew! got my result }); }); }); });
  • 24. Async Flow Control ● Callback hell can be avoided by controlling the program flow ● Async.JS is an excellent library to control the callback flow ● Promises Pattern can be very useful with Async Operations
  • 25. Async Flow Control ● Callback hell can be avoided by controlling the program flow ● Async.JS is an excellent library to control the callback flow ● Promises Pattern can be very useful with Async Operations
  • 26. Tips & Tricks ● use + to convert expressions to a number ○ +new Date() gives Timestamp ● use !! to convert any expression to a boolean ● Append array to another array ○ a = [1,2,3]; b= [4,5,6] ○ Array.prototype.push.apply(a,b)
  • 27. Exercises ● Add a loop() method to the Prototype of Array ● Implement basic Inheritance with an example of Employee ● print numbers 1..5, such that every number is printed after 500ms