You are on page 1of 60

JAVA SCRIPT

JavaScript is a powerful programming language that can add interactivity to a website. It was
invented by Brendan Eich.
JavaScript is versatile and beginner-friendly. With more experience, you'll be able to create
games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more!
Using Chrome Browser
Console
VARIABLES
// Using var The var was keyword was commonly used in JavaScript from 1995 to 2015. However,
var x = 5; it’s now considered outdated and should only be used for older browsers.
var y = 6;
var z = x + y;

// Using let Using let was introduced in 2015, let allows you to declare variables that can
x = 5; let x = 5; be reassigned.
y = 6; let y = 6;
let z = x + y;
z = x + y;
// Using const
const x = 5; Using const was introduced in 2015, const declares variables
const y = 6; with constant values that cannot be changed.
const z = x + y;
let
Variables declared with let are limited in scope to the block, statement, or expression where they are
used.
const
When you declare a variable using const, its value cannot be changed after initialization. It provides block scope,
similar to let
ARITHMETIC OPERATOR
JAVA STRING OPERATORS
If , else
If , else
If , else
If , else if
SWITCH STATEMENT
CONDITIONAL TRUE or FALSE
FOR LOOPS
ARRAY
Parameters and Arguments
Nested Object
To access Objects in For Loop using
[]
Parameters
JAVASCRIPT APPS (NOTES)
Expected Output
index.html
style.css
script.js
script.js
script.js
JavaScript Calculator
index.html
style.css
script.js
FORM
HTML and CSS
Save your file as index.html Save your file as style.css
Shortcut for html: Shortcut for css:
• type “ link: css “
• type “!”
• and click Enter
• and click Enter

You might also like