SlideShare a Scribd company logo
JavaScript
Module I
by
Mustafa Qamar-ud-Din
m.qamaruddin@outlook.com
Agenda

Why JavaScript?

Data Types

Flow Control Structures

Functions
− Nested Functions
− Recursion
− Closures

Error Handling

Objects
− Built-in Objects
− User-defined Objects

Document Object Model
− DOM Level 1
− DOM Level 2
− DOM Level 3

Interview Questions

Recommended Readings

What’s Next?

Hands On
Why JavaScript?
"JavaScript is
the only
language that
I’m aware of
that people feel
they don’t need
to learn before
they start using
it."
- Douglas Crockford
Why JavaScript?

Web Development
− Client-Side
− Server-Side

Mobile Applications

Windows 8
Applications

Chrome Extensions

VR

Games & Graphics

Desktop Applications
(Elektron)
Data Types

Statements

Expressions

Variables
− Hoisting

Constants
− Immutable
Identifiers
− Mutable Values

Operators
− Assignment
− Increment,

Weakly Typed
− Type Coercion
− Dynamic Typing

Primitive Types
− Booleans
− Numbers
− Strings
− Null
− Undefined
− NaN
− Symbols (ES6)
Flow Control Structures

if

if / else

if / else if / else

while

do while

for

switch

continue

break
Functions (First-class_function)

Nested Functions

Recursion

Closures

Self Invoking Functions
Nested Functions
Create a function sum
that will work like
that:
sum(a)(b) = a+b.
Yes, the syntax is
dual brackets. Funny,
isn’t it? For
instance:
sum(1)(2) = 3
Sum(5)(-1) = 4
Nested Functions
Create a function sum
that will work like
that:
sum(a)(b) = a+b and
accepts any number of
brackets.
For instance:
sum(1)(2) == 3
sum(5)(-1)(2) == 6
sum(6)(-1)(-2)(-3) ==
0
Sum(0)(1)(2)(3)(4)(5)
Closures
Here is a function to create an army of shooters:
function makeArmy() {
var shooters = []
for(var i=0; i<10; i++) {
var shooter = function() { // a shooter is a function
alert(i) // which should alert it's number
}
shooters.push(shooter)
}
return shooters
}
var army = makeArmy()
Error Handling

try catch finally

window.onerror
Objects

Built-in Objects

User-defined Objects
− Function
− JSON
− Associative Array

Pass by Value & Reference

Prototype Chain
Built-in Objects

Number

String
− getIndexOf
− getLastIndexOf
− search

RegEx
− match
− exec
− test

Date
− getTime / setTime
Objects

Built-in Objects

User-defined Objects
− Function
− JSON
− Associative Array

Pass by Value & Reference

Prototype Chain
Objects

Methods
− is
− hasOwnProperty
− isPrototypeOf
− toString
− toSource
− valueOf
− apply
− bind
− Call

Operators

More Related Content

Similar to Java Script - Module I (20)

PPSX
Javascript variables and datatypes
Varun C M
 
PDF
slides-students-C03.pdf
HARDIKGUPTAMCO21373
 
PDF
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
PDF
JavaScript Interview Questions and Answers | Full Stack Web Development Train...
Edureka!
 
PPS
CS101- Introduction to Computing- Lecture 23
Bilal Ahmed
 
PPTX
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 
PPT
Intermediate JavaScript
☆ Milan Adamovsky ☆
 
PPT
JavaScript Tutorial
Bui Kiet
 
PDF
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
AlexShon3
 
PDF
JavaScript Basics and Best Practices - CC FE & UX
JWORKS powered by Ordina
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
PPTX
Paca java script slid
pacatarpit
 
PPT
13665449.ppt
JP Chicano
 
PPTX
Class[2][29th may] [javascript]
Saajid Akram
 
PDF
Client sidescripting javascript
Selvin Josy Bai Somu
 
PDF
03 Advanced JavaScript
Ynon Perek
 
PPTX
Unit - 4 all script are here Javascript.pptx
kushwahanitesh592
 
PPT
JavaScript - Programming Languages course
yoavrubin
 
PPTX
Introduction to JavaScript
SadhanaParameswaran
 
PDF
Grant Rogerson SDEC2015
Grant Rogerson
 
Javascript variables and datatypes
Varun C M
 
slides-students-C03.pdf
HARDIKGUPTAMCO21373
 
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
JavaScript Interview Questions and Answers | Full Stack Web Development Train...
Edureka!
 
CS101- Introduction to Computing- Lecture 23
Bilal Ahmed
 
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 
Intermediate JavaScript
☆ Milan Adamovsky ☆
 
JavaScript Tutorial
Bui Kiet
 
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
AlexShon3
 
JavaScript Basics and Best Practices - CC FE & UX
JWORKS powered by Ordina
 
JavaScript - An Introduction
Manvendra Singh
 
Paca java script slid
pacatarpit
 
13665449.ppt
JP Chicano
 
Class[2][29th may] [javascript]
Saajid Akram
 
Client sidescripting javascript
Selvin Josy Bai Somu
 
03 Advanced JavaScript
Ynon Perek
 
Unit - 4 all script are here Javascript.pptx
kushwahanitesh592
 
JavaScript - Programming Languages course
yoavrubin
 
Introduction to JavaScript
SadhanaParameswaran
 
Grant Rogerson SDEC2015
Grant Rogerson
 

Recently uploaded (20)

PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Ad

Java Script - Module I