SlideShare a Scribd company logo
https://fnurpandi.wordpress.com/
JavaScript
Finsa Nurpandi
finsa@unsur.ac.id
Universitas Suryakancana Cianjur
https://fnurpandi.wordpress.com/
https://fnurpandi.wordpress.com/
Operation System
Web Browser
SCRIPTING LANGUAGE
C++ Apps Java Apps .NET Apps
Web Page
JavaScript
can’t access local files
can’t directly access database
can’t access hardware
https://fnurpandi.wordpress.com/
JavaScript
is a
client-side language
https://fnurpandi.wordpress.com/
JavaScript
is not
java
https://fnurpandi.wordpress.com/
JavaScript
is
Interpreted
not
compiled
https://fnurpandi.wordpress.com/
Javascript
is
Case
Sensitive!
https://fnurpandi.wordpress.com/
alert(“Hello world”);
Alert(“Hello world”);
https://fnurpandi.wordpress.com/
JAVASCRIPT STATEMENT
alert(“hello world”); alert(“another message”);
This is realy realy realy realy realy realy realy realy complex message
https://fnurpandi.wordpress.com/
JAVASCRIPT IS WHITESPACE INSENSITIVE
alert(“hello world”);
alert( “hello world” );
alert
( “hello world”
);
alert(“hello world”);
https://fnurpandi.wordpress.com/
JAVASCRIPT COMMENT
//this is a comment
alert(“hello”); //this is a comment too
/*
this is
a multiple line
comment */
https://fnurpandi.wordpress.com/
WHERE TO PUT JAVASCRIPT
See the example...
https://fnurpandi.wordpress.com/
VARIABLES
var year;
var customerEmail;
var todaysdate;
var foo;
var x;
var 99problems;
var problems99;
letters
numbers
_
$
https://fnurpandi.wordpress.com/
VARIABLES DECLARATION
var, let, const
https://fnurpandi.wordpress.com/
VAR
https://fnurpandi.wordpress.com/
VAR
https://fnurpandi.wordpress.com/
LET
https://fnurpandi.wordpress.com/
LET
https://fnurpandi.wordpress.com/
LET
https://fnurpandi.wordpress.com/
LET
https://fnurpandi.wordpress.com/
CONST
https://fnurpandi.wordpress.com/
CONST
https://fnurpandi.wordpress.com/
CONST
https://fnurpandi.wordpress.com/
CONDITIONAL CODE
if ( condition ) {
// code goes here
// ...
} else {
// otherwise, different code
}
https://fnurpandi.wordpress.com/
OPERATORS AND
EXPRESSIONS
https://fnurpandi.wordpress.com/
ARITHMETIC OPERATORS
* / + -
https://fnurpandi.wordpress.com/
ASSIGNMENT OPERATORS
= += -= *= /=
https://fnurpandi.wordpress.com/
EQUALITY
= assignment
== equality
=== strict equality
https://fnurpandi.wordpress.com/
LOGICAL AND / OR
if ( a === b && c === d ) { ...
if ( a === b || c === d ) { ...
if ( (a > b) && (c < d) ) { ...
https://fnurpandi.wordpress.com/
MODULUS
var year = 2003;
var remainders = year % 4; // remainder is 3
https://fnurpandi.wordpress.com/
INCREMENT/DECREMENT
a = a + 1 a = a – 1
a += 1 a -= 1
a++; //postfix a--;
++a; //prefix --a;
https://fnurpandi.wordpress.com/
WORKING WITH LOOPS
https://fnurpandi.wordpress.com/
WHILE LOOP
var a = 1;
while ( a < number ) {
document.write(a);
a++;
}
https://fnurpandi.wordpress.com/
DO… WHILE LOOP
var a = 1;
do {
document.write(a);
a++;
} while ( a < number );
https://fnurpandi.wordpress.com/
FOR LOOP
for ( var i = 1; i < 10; i++) {
// do stuff
// do stuff
// do stuff
// etc..
}
https://fnurpandi.wordpress.com/
BREAK
for ( var i = 1; i < 100; i++) {
// do stuff
// do stuff
if ( i == 5) {
break;
}
// do stuff
}
// break jumps out the loop
https://fnurpandi.wordpress.com/
CONTINUE
for ( var i = 1; i < 100; i++) {
// do stuff
// do stuff
if ( i == 5) {
continue;
}
// do stuff
}
https://fnurpandi.wordpress.com/
FUNCTIONS
function myfunction (){
document.write (“test function”);
}
myFunction();
https://fnurpandi.wordpress.com/
FUNCTIONS WITH PARAMETER
function myfunction ( x,y ){
var result = x*y;
document.write(result);
}
myFunction(200,300);
https://fnurpandi.wordpress.com/
REFERENCES
• https://www.w3schools.com/js/
• https://javascript.info/
• https://www.tutorialspoint.com/javascript/
https://fnurpandi.wordpress.com/
The end.

More Related Content

What's hot (20)

PPTX
Javascript functions
Alaref Abushaala
 
PPT
Java Script ppt
Priya Goyal
 
PPTX
Lab #2: Introduction to Javascript
Walid Ashraf
 
PPT
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
PPT
Javascript
mussawir20
 
PDF
Javascript
Momentum Design Lab
 
PDF
The New JavaScript: ES6
Rob Eisenberg
 
PDF
JavaScript Programming
Sehwan Noh
 
PPTX
Angular tutorial
Rohit Gupta
 
PPT
Introduction to Javascript
Amit Tyagi
 
PPT
JavaScript Tutorial
Bui Kiet
 
PPT
JavaScript Basics
Mats Bryntse
 
PPT
Control Structures In Php 2
Digital Insights - Digital Marketing Agency
 
PPTX
Introduction to JavaScript
Marlon Jamera
 
PPTX
Java script
Shyam Khant
 
PDF
jQuery for beginners
Arulmurugan Rajaraman
 
PDF
JavaScript - Chapter 5 - Operators
WebStackAcademy
 
PDF
Basics of JavaScript
Bala Narayanan
 
PPTX
Modern JS with ES6
Kevin Langley Jr.
 
PPT
JavaScript Control Statements I
Reem Alattas
 
Javascript functions
Alaref Abushaala
 
Java Script ppt
Priya Goyal
 
Lab #2: Introduction to Javascript
Walid Ashraf
 
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
Javascript
mussawir20
 
The New JavaScript: ES6
Rob Eisenberg
 
JavaScript Programming
Sehwan Noh
 
Angular tutorial
Rohit Gupta
 
Introduction to Javascript
Amit Tyagi
 
JavaScript Tutorial
Bui Kiet
 
JavaScript Basics
Mats Bryntse
 
Control Structures In Php 2
Digital Insights - Digital Marketing Agency
 
Introduction to JavaScript
Marlon Jamera
 
Java script
Shyam Khant
 
jQuery for beginners
Arulmurugan Rajaraman
 
JavaScript - Chapter 5 - Operators
WebStackAcademy
 
Basics of JavaScript
Bala Narayanan
 
Modern JS with ES6
Kevin Langley Jr.
 
JavaScript Control Statements I
Reem Alattas
 

Similar to JavaScript Basic (20)

PDF
Transforming WebSockets
Arnout Kazemier
 
PPTX
VR Without Borders RIVER WebVR April 2015
Tony Parisi
 
PPTX
Up And Running With Web VR Fall 2014
Tony Parisi
 
TXT
If love is_blind_-_tiffany
tenka
 
PDF
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Errazudin Ishak
 
PPTX
Browser-Based Virtual Reality April 2015
Tony Parisi
 
PDF
Nginx Workshop Aftermath
Denis Zhdanov
 
PPT
Lecture 5 - Comm Lab: Web @ ITP
yucefmerhi
 
PDF
JQuery UK February 2015: Service Workers On Vacay
Natasha Rooney
 
PDF
JQuery UK Service Workers Talk
Natasha Rooney
 
PDF
Unlocked Nov 2013: Main Slide Pack
Rackspace Academy
 
PDF
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Ismail Tasdelen
 
PPT
Node.js: CAMTA Presentation
Rob Tweed
 
PPTX
Hacking Reality: Browser-Based VR with HTML5
Tony Parisi
 
PDF
Web development in Lua @ FOSDEM 2016
Etiene Dalcol
 
PPTX
The Atmosphere Framework
jfarcand
 
PDF
DrupalCon jQuery
Nathan Smith
 
KEY
Sprockets
Christophe Porteneuve
 
PPTX
Spring Surf 101
Alfresco Software
 
PDF
Adriano Di Luzio - Davvy - PyconSEI Talk
aldur999
 
Transforming WebSockets
Arnout Kazemier
 
VR Without Borders RIVER WebVR April 2015
Tony Parisi
 
Up And Running With Web VR Fall 2014
Tony Parisi
 
If love is_blind_-_tiffany
tenka
 
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Errazudin Ishak
 
Browser-Based Virtual Reality April 2015
Tony Parisi
 
Nginx Workshop Aftermath
Denis Zhdanov
 
Lecture 5 - Comm Lab: Web @ ITP
yucefmerhi
 
JQuery UK February 2015: Service Workers On Vacay
Natasha Rooney
 
JQuery UK Service Workers Talk
Natasha Rooney
 
Unlocked Nov 2013: Main Slide Pack
Rackspace Academy
 
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Ismail Tasdelen
 
Node.js: CAMTA Presentation
Rob Tweed
 
Hacking Reality: Browser-Based VR with HTML5
Tony Parisi
 
Web development in Lua @ FOSDEM 2016
Etiene Dalcol
 
The Atmosphere Framework
jfarcand
 
DrupalCon jQuery
Nathan Smith
 
Spring Surf 101
Alfresco Software
 
Adriano Di Luzio - Davvy - PyconSEI Talk
aldur999
 
Ad

Recently uploaded (20)

PDF
Comprehensive Guide to Writing Effective Literature Reviews for Academic Publ...
AJAYI SAMUEL
 
PPTX
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
Modern analytical techniques used to characterize organic compounds. Birbhum ...
AyanHossain
 
PPTX
HIRSCHSPRUNG'S DISEASE(MEGACOLON): NURSING MANAGMENT.pptx
PRADEEP ABOTHU
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PPTX
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
PPTX
Latest Features in Odoo 18 - Odoo slides
Celine George
 
PPTX
Presentation: Climate Citizenship Digital Education
Karl Donert
 
PDF
07.15.2025 - Managing Your Members Using a Membership Portal.pdf
TechSoup
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PPTX
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PPTX
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
THE HUMAN INTEGUMENTARY SYSTEM#MLT#BCRAPC.pptx
Subham Panja
 
PPTX
Various Psychological tests: challenges and contemporary trends in psychologi...
santoshmohalik1
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PDF
Right to Information.pdf by Sapna Maurya XI D
Directorate of Education Delhi
 
PPTX
ABDOMINAL WALL DEFECTS:GASTROSCHISIS, OMPHALOCELE.pptx
PRADEEP ABOTHU
 
PPTX
Mrs Mhondiwa Introduction to Algebra class
sabinaschimanga
 
Comprehensive Guide to Writing Effective Literature Reviews for Academic Publ...
AJAYI SAMUEL
 
CLEFT LIP AND PALATE: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Modern analytical techniques used to characterize organic compounds. Birbhum ...
AyanHossain
 
HIRSCHSPRUNG'S DISEASE(MEGACOLON): NURSING MANAGMENT.pptx
PRADEEP ABOTHU
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
Latest Features in Odoo 18 - Odoo slides
Celine George
 
Presentation: Climate Citizenship Digital Education
Karl Donert
 
07.15.2025 - Managing Your Members Using a Membership Portal.pdf
TechSoup
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
ANORECTAL MALFORMATIONS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
THE HUMAN INTEGUMENTARY SYSTEM#MLT#BCRAPC.pptx
Subham Panja
 
Various Psychological tests: challenges and contemporary trends in psychologi...
santoshmohalik1
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
Right to Information.pdf by Sapna Maurya XI D
Directorate of Education Delhi
 
ABDOMINAL WALL DEFECTS:GASTROSCHISIS, OMPHALOCELE.pptx
PRADEEP ABOTHU
 
Mrs Mhondiwa Introduction to Algebra class
sabinaschimanga
 
Ad

JavaScript Basic