SlideShare ist ein Scribd-Unternehmen logo
1 von 41
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.

Weitere ähnliche Inhalte

Was ist angesagt?

1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
apnwebdev
 

Was ist angesagt? (20)

Javascript
JavascriptJavascript
Javascript
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Javascript
JavascriptJavascript
Javascript
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Ajax Ppt
Ajax PptAjax Ppt
Ajax Ppt
 
HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)HTML/CSS Crash Course (april 4 2017)
HTML/CSS Crash Course (april 4 2017)
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Css ppt
Css pptCss ppt
Css ppt
 
SASS - CSS with Superpower
SASS - CSS with SuperpowerSASS - CSS with Superpower
SASS - CSS with Superpower
 

Ähnlich wie JavaScript Basic

If love is_blind_-_tiffany
If love is_blind_-_tiffanyIf love is_blind_-_tiffany
If love is_blind_-_tiffany
tenka
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITP
yucefmerhi
 

Ähnlich wie JavaScript Basic (20)

Transforming WebSockets
Transforming WebSocketsTransforming WebSockets
Transforming WebSockets
 
VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015
 
Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014
 
If love is_blind_-_tiffany
If love is_blind_-_tiffanyIf love is_blind_-_tiffany
If love is_blind_-_tiffany
 
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and CapistranoDevelop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
 
Browser-Based Virtual Reality April 2015
Browser-Based Virtual Reality April 2015Browser-Based Virtual Reality April 2015
Browser-Based Virtual Reality April 2015
 
Nginx Workshop Aftermath
Nginx Workshop AftermathNginx Workshop Aftermath
Nginx Workshop Aftermath
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITP
 
JQuery UK February 2015: Service Workers On Vacay
JQuery UK February 2015: Service Workers On VacayJQuery UK February 2015: Service Workers On Vacay
JQuery UK February 2015: Service Workers On Vacay
 
JQuery UK Service Workers Talk
JQuery UK Service Workers TalkJQuery UK Service Workers Talk
JQuery UK Service Workers Talk
 
Unlocked Nov 2013: Main Slide Pack
Unlocked Nov 2013: Main Slide PackUnlocked Nov 2013: Main Slide Pack
Unlocked Nov 2013: Main Slide Pack
 
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
 
Node.js: CAMTA Presentation
Node.js: CAMTA PresentationNode.js: CAMTA Presentation
Node.js: CAMTA Presentation
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5
 
Web development in Lua @ FOSDEM 2016
Web development in Lua @ FOSDEM 2016Web development in Lua @ FOSDEM 2016
Web development in Lua @ FOSDEM 2016
 
The Atmosphere Framework
The Atmosphere FrameworkThe Atmosphere Framework
The Atmosphere Framework
 
DrupalCon jQuery
DrupalCon jQueryDrupalCon jQuery
DrupalCon jQuery
 
Sprockets
SprocketsSprockets
Sprockets
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talk
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 

JavaScript Basic