SlideShare a Scribd company logo
Introduction to JavaScript
HTML5, CSS3, Javascript and Jquery
by: Seshu Puvvada
1
Introduction
 What is JavaScript
 How does it work
 Any PC, any OS, any Browser
 ECMAScript 5
 ECMAScript 6/ ES6/ ES Next
 Case Sensitive
Prototype-based programming
 Class less programming
 Prototype-based programming is an OOP model that doesn't use classes, but
rather it first accomplishes the behavior of any class and then reuses it by
decorating existing prototype objects.
Script block
 Internal scripting
 <script> </script>
 External scripting
 <script src="js/filename.js"></script>
Document Vs Window
Document Object Model
AXP Internal
Simple DOM Manipulation
 What is function
 What is event
<!DOCTYPE html>
<html>
<head>
<title>Welcome to JS</title>
<script>
function changedata(){
document.getElementById('description').innerHTML = "Text has been changed";
}
</script>
</head>
<body>
<p id="description" > Testing paragraph </p>
<input type="submit" value="Change Data" onclick="changedata()">
</body>
</html>
Dynamic Typing
 JavaScript is a loosely typed or a dynamic language. That means you don't
have to declare the type of a variable ahead of time. The type will get
determined automatically while the program is being processed. That also
means that you can have the same variable as different types
 var foo = 42; // foo is now a Number
 var foo = "bar"; // foo is now a String
 var foo = true; // foo is now a Boolean
Data types
 Primitive Data type
 Boolean (true/false)
 Null (null)
 Undefined(not assigned any value)
 Number
 String
 Symbol (ES 6)
 Object
Variables
 var keyword
 Scope
 Global and local variable
 Variable declaration
 var x = 1;
 var str = ‘hai’;
 var isStr = true;
 Printing variable – console.log(var names)
 typeof -- to find variable type
Logical Operators
 == equal to
 === equal value and equal type
 != not equal
 !== not equal value or not equal type
 > greater than
 < less than
 >= greater than or equal to
 <= less than or equal to
Program Flow
 Conditional statements
 if
 if, else
 if, else, else if
 while
 do while
 for
 break
 switch
 Functions
 Function
 Function with input parameters
 Function with and without return
Object
 An Object is collection of properties. These properties can either be
primitive datatypes or other objects or functions.
 Predefined objects array, date etc…
 Custom objects
 Var obj = { };
Array
 Array – to store multiple values in single variable
 Var myarr = [‘one’, ‘two’, ‘three’];
 Accessing array items – myarr[1]
 Changing elements myarr[1]
 STACK principle – LIFO
 Properties
 Length
 Push
 Pop
 toString()
 Join(“ “)
 Shift – removed element at first place (index 0)
 Unshift – adds element at firstplace
 Splice(2, 0 , obj1, obj2) – add items at position 2, 0 don’t delete any items
 Sort – default sort
 Concat – arr1.concat(arr2) – will add arr2 to arr1
 Slice(1, 3) – slice elements from index 1 to 3.
String properties
 Str.length
 Escape char – “I am ”frontend developer””
 n – for new line
 indexOf
 lastIndexOf
 Replace
 Search
 Split – convert string to array
 Substr
 Substring
 toLowerCase
 toUpperCase
Error handling
 Try
 Catch
 Finally
 Throw
 try{
//something here
throw “custom error” ;
}catch(err){
}finally{
//something here
}
DOM Manipulation methods
AXP Internal

More Related Content

PDF
Activator and Reactive at Play NYC meetup
PDF
JavaScript - Chapter 6 - Basic Functions
PPSX
Javascript variables and datatypes
PDF
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
PPTX
ODP
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
ODP
Functional programming with Scala
PPTX
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
Activator and Reactive at Play NYC meetup
JavaScript - Chapter 6 - Basic Functions
Javascript variables and datatypes
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Functional programming with Scala
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...

What's hot (20)

PDF
javascript objects
PPT
OOP in JavaScript
PPTX
javascript
PPTX
Object Oriented JavaScript - II
PDF
JavaScript - Chapter 8 - Objects
PDF
3.1 javascript objects_DOM
KEY
PDF
What's New in Django 1.6
PDF
Underscore and Backbone Models
PDF
Mobile Day - React Native
PPTX
Object Oriented Programing in JavaScript
PDF
Ten useful JavaScript tips & best practices
PDF
What's new in Django 1.7
PDF
Scala.js - yet another what..?
PDF
Fii Practic Frontend - BeeNear - laborator3
PDF
Introduction to Jquery
PDF
React redux
PPTX
Java scriptforjavadev part2a
PPTX
Lecture 6: Client Side Programming 2
javascript objects
OOP in JavaScript
javascript
Object Oriented JavaScript - II
JavaScript - Chapter 8 - Objects
3.1 javascript objects_DOM
What's New in Django 1.6
Underscore and Backbone Models
Mobile Day - React Native
Object Oriented Programing in JavaScript
Ten useful JavaScript tips & best practices
What's new in Django 1.7
Scala.js - yet another what..?
Fii Practic Frontend - BeeNear - laborator3
Introduction to Jquery
React redux
Java scriptforjavadev part2a
Lecture 6: Client Side Programming 2
Ad

Viewers also liked (11)

ODT
Jooker
PPTX
sensi protective auto's.
DOC
Guia. Primer Formato, TamañO
DOCX
Plots in neemrana behror,nh8
PDF
cert compressed
DOC
Tableau des manifestations 2014 mdesp
DOC
OLABISI RAIMI - CV May 2015
PDF
UCM Dean's List
PPTX
Impact of sales promotion
DOC
Plantilla evaluación individual tutores intef
TXT
Auto biography
Jooker
sensi protective auto's.
Guia. Primer Formato, TamañO
Plots in neemrana behror,nh8
cert compressed
Tableau des manifestations 2014 mdesp
OLABISI RAIMI - CV May 2015
UCM Dean's List
Impact of sales promotion
Plantilla evaluación individual tutores intef
Auto biography
Ad

Similar to Introduction to JavaScrtipt (20)

PPT
Javascript
PPT
JavaScript - An Introduction
PPTX
Java Script Basic to Advanced For Beginner to Advanced Learner.pptx
PDF
JavaScript Getting Started
PPTX
Java script
PPT
JavaScript Workshop
PPTX
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
PPT
JavaScript Tutorial
PPTX
gdscWorkShopJavascriptintroductions.pptx
PPTX
Javascript
PPT
Javascript.ppt
PDF
Client sidescripting javascript
PPTX
Javascript
PPTX
An introduction to javascript
PPTX
JavaScript_III.pptx
PPTX
Learn JavaScript From Scratch
PPTX
javascript client side scripting la.pptx
PPTX
Javascript
PPTX
FFW Gabrovo PMG - JavaScript 1
PPTX
JavaScript.pptx
Javascript
JavaScript - An Introduction
Java Script Basic to Advanced For Beginner to Advanced Learner.pptx
JavaScript Getting Started
Java script
JavaScript Workshop
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
JavaScript Tutorial
gdscWorkShopJavascriptintroductions.pptx
Javascript
Javascript.ppt
Client sidescripting javascript
Javascript
An introduction to javascript
JavaScript_III.pptx
Learn JavaScript From Scratch
javascript client side scripting la.pptx
Javascript
FFW Gabrovo PMG - JavaScript 1
JavaScript.pptx

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation theory and applications.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
Big Data Technologies - Introduction.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Digital-Transformation-Roadmap-for-Companies.pptx
The AUB Centre for AI in Media Proposal.docx
The Rise and Fall of 3GPP – Time for a Sabbatical?
MIND Revenue Release Quarter 2 2025 Press Release
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation theory and applications.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development

Introduction to JavaScrtipt

  • 1. Introduction to JavaScript HTML5, CSS3, Javascript and Jquery by: Seshu Puvvada 1
  • 2. Introduction  What is JavaScript  How does it work  Any PC, any OS, any Browser  ECMAScript 5  ECMAScript 6/ ES6/ ES Next  Case Sensitive
  • 3. Prototype-based programming  Class less programming  Prototype-based programming is an OOP model that doesn't use classes, but rather it first accomplishes the behavior of any class and then reuses it by decorating existing prototype objects.
  • 4. Script block  Internal scripting  <script> </script>  External scripting  <script src="js/filename.js"></script>
  • 7. Simple DOM Manipulation  What is function  What is event <!DOCTYPE html> <html> <head> <title>Welcome to JS</title> <script> function changedata(){ document.getElementById('description').innerHTML = "Text has been changed"; } </script> </head> <body> <p id="description" > Testing paragraph </p> <input type="submit" value="Change Data" onclick="changedata()"> </body> </html>
  • 8. Dynamic Typing  JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. That also means that you can have the same variable as different types  var foo = 42; // foo is now a Number  var foo = "bar"; // foo is now a String  var foo = true; // foo is now a Boolean
  • 9. Data types  Primitive Data type  Boolean (true/false)  Null (null)  Undefined(not assigned any value)  Number  String  Symbol (ES 6)  Object
  • 10. Variables  var keyword  Scope  Global and local variable  Variable declaration  var x = 1;  var str = ‘hai’;  var isStr = true;  Printing variable – console.log(var names)  typeof -- to find variable type
  • 11. Logical Operators  == equal to  === equal value and equal type  != not equal  !== not equal value or not equal type  > greater than  < less than  >= greater than or equal to  <= less than or equal to
  • 12. Program Flow  Conditional statements  if  if, else  if, else, else if  while  do while  for  break  switch  Functions  Function  Function with input parameters  Function with and without return
  • 13. Object  An Object is collection of properties. These properties can either be primitive datatypes or other objects or functions.  Predefined objects array, date etc…  Custom objects  Var obj = { };
  • 14. Array  Array – to store multiple values in single variable  Var myarr = [‘one’, ‘two’, ‘three’];  Accessing array items – myarr[1]  Changing elements myarr[1]  STACK principle – LIFO  Properties  Length  Push  Pop  toString()  Join(“ “)  Shift – removed element at first place (index 0)  Unshift – adds element at firstplace  Splice(2, 0 , obj1, obj2) – add items at position 2, 0 don’t delete any items  Sort – default sort  Concat – arr1.concat(arr2) – will add arr2 to arr1  Slice(1, 3) – slice elements from index 1 to 3.
  • 15. String properties  Str.length  Escape char – “I am ”frontend developer””  n – for new line  indexOf  lastIndexOf  Replace  Search  Split – convert string to array  Substr  Substring  toLowerCase  toUpperCase
  • 16. Error handling  Try  Catch  Finally  Throw  try{ //something here throw “custom error” ; }catch(err){ }finally{ //something here }

Editor's Notes

  • #10: Primitive Data type – is data that is not an object and has no methods. s