SlideShare a Scribd company logo
Variables & types
Flow
control
Functions
Javascript basics Andrea Tino
This document uses graphic assets from Freepik
var name = init-value ;
var name ;
Variables are used to store values
and retrieve them later. They are
essential building blocks in every
program you will ever write.
Javascript
supports very
basic types:
strings and
numbers.
var str = “hello”;
var integer = 10;
var decimal = 1.5;
var num1 = 1/2;
var num2 = num1*2;
var myvar = 0;
console.log(myvar);
code
if ( condition ) {
}
Javascript is a programming
language very simple but
extremely powerful. It is used
by browsers today so that web
pages can be interactive and
very dynamic.
In your favorite browser’s
window, hit F12 and bring up
the Developer Tools. You can
write some Javascript in the
console tab to have some fun.
Sometimes you ant certain code to be
executed, but not always.
Conditionals are used to execute
code only when one or more
conditions are met.
Loops (or cycles) are used everytime
you want to execute the same code
many times.
code
for (var i=0; i< n ; i++) {
}
if (1 < 2) {
alert(”Hi!”);
}
for (var i=0; i<10; i++) {
console.log(”This is:” + i);
}
What if you have a piece of code you
end up executing many times in
different parts of your code?
Functions help you modularize and
reuse pieces of code that you execute
very often in your program.
code
function name ( args ) {
}
A function must first be declared:
function-name ( args );
Then a function can be invoked:
function greetMe (name) {
alert(”Hello ” + name);
}
greetMe (”Batman”);

More Related Content

What's hot (20)

PDF
Node.js Jump Start
Haim Michael
 
PPTX
Everything you need to know about mern stack programming
JAMESJOHN130
 
PPTX
Demand driven applications with om.next and react native
dvcrn
 
PPT
Top java script frameworks ppt
Omkarsoft Bangalore
 
PPTX
Visual Studio: The best tool for web developers.
Robert MacLean
 
PPTX
Windows Store Apps: Tips & Tricks
Robert MacLean
 
PDF
Use html5 to build what you want, where you want it
Kevin DeRudder
 
PDF
High Productivity Web Development Workflow
Vũ Nguyễn
 
PPT
MSDN Live: Windows Presentation Foundations Line of Business Apps
goeran
 
PDF
React Typescript for beginners: Translator app with Microsoft cognitive services
Fabio Biondi
 
PDF
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Dat Hoang
 
PPTX
Continuous workflow for a large react native app - mobile at wix
Shalom Yerushalmy
 
PPTX
Ppt full stack developer
SudhirVarpe1
 
PPTX
Silverlight 4 @ MSDN Live
goeran
 
PDF
Wso2 product release webinar introducing jaggery
WSO2
 
PDF
6 Topmost JavaScript Framework for 2021
Riya Thomas
 
PPTX
Javascript and DOM
Ketan Ghumatkar
 
PPTX
JavaScript Toolkit
Robert MacLean
 
PPTX
Vaadin slides for @Devoxx 2012
Nicolas Fränkel
 
PDF
How To be a Backend developer
Ramy Hakam
 
Node.js Jump Start
Haim Michael
 
Everything you need to know about mern stack programming
JAMESJOHN130
 
Demand driven applications with om.next and react native
dvcrn
 
Top java script frameworks ppt
Omkarsoft Bangalore
 
Visual Studio: The best tool for web developers.
Robert MacLean
 
Windows Store Apps: Tips & Tricks
Robert MacLean
 
Use html5 to build what you want, where you want it
Kevin DeRudder
 
High Productivity Web Development Workflow
Vũ Nguyễn
 
MSDN Live: Windows Presentation Foundations Line of Business Apps
goeran
 
React Typescript for beginners: Translator app with Microsoft cognitive services
Fabio Biondi
 
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Dat Hoang
 
Continuous workflow for a large react native app - mobile at wix
Shalom Yerushalmy
 
Ppt full stack developer
SudhirVarpe1
 
Silverlight 4 @ MSDN Live
goeran
 
Wso2 product release webinar introducing jaggery
WSO2
 
6 Topmost JavaScript Framework for 2021
Riya Thomas
 
Javascript and DOM
Ketan Ghumatkar
 
JavaScript Toolkit
Robert MacLean
 
Vaadin slides for @Devoxx 2012
Nicolas Fränkel
 
How To be a Backend developer
Ramy Hakam
 

Similar to Javascript cheatsheet (20)

PPTX
Pawanasfdcvgfgfxgndrfdrxjdrfmjfgtdtdt.pptx
ramtiwari7081
 
PPTX
Pawangvvhgvhg hbhvhhhhvhjjkvhvghvhgh.pptx
ramtiwari7081
 
PDF
Fii Practic Frontend - BeeNear - laborator3
BeeNear
 
PPTX
Java script
Jay Patel
 
PPT
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
PPTX
Java script session 3
Saif Ullah Dar
 
PPT
Java Script
Sarvan15
 
PDF
Java Script
Sarvan15
 
PPT
Presentation JavaScript Introduction Data Types Variables Control Structure
SripathiRavi1
 
PPTX
Js datatypes
Sireesh K
 
PPTX
CSC PPT 13.pptx
DrRavneetSingh
 
PDF
Javascript
20261A05H0SRIKAKULAS
 
PPTX
Placement and variable 03 (js)
AbhishekMondal42
 
PPTX
javascript client side scripting la.pptx
lekhacce
 
PPTX
Java script.pptx v
22x026
 
PPTX
Introduction to JavaScript Programming
Raveendra R
 
PPTX
Java script
Shyam Khant
 
PDF
JavaScript Basics and Best Practices - CC FE & UX
JWORKS powered by Ordina
 
PDF
any things about myself and that css tble
sahimhdsm12
 
PPTX
JavaScript.pptx
KennyPratheepKumar
 
Pawanasfdcvgfgfxgndrfdrxjdrfmjfgtdtdt.pptx
ramtiwari7081
 
Pawangvvhgvhg hbhvhhhhvhjjkvhvghvhgh.pptx
ramtiwari7081
 
Fii Practic Frontend - BeeNear - laborator3
BeeNear
 
Java script
Jay Patel
 
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
Java script session 3
Saif Ullah Dar
 
Java Script
Sarvan15
 
Java Script
Sarvan15
 
Presentation JavaScript Introduction Data Types Variables Control Structure
SripathiRavi1
 
Js datatypes
Sireesh K
 
CSC PPT 13.pptx
DrRavneetSingh
 
Placement and variable 03 (js)
AbhishekMondal42
 
javascript client side scripting la.pptx
lekhacce
 
Java script.pptx v
22x026
 
Introduction to JavaScript Programming
Raveendra R
 
Java script
Shyam Khant
 
JavaScript Basics and Best Practices - CC FE & UX
JWORKS powered by Ordina
 
any things about myself and that css tble
sahimhdsm12
 
JavaScript.pptx
KennyPratheepKumar
 
Ad

More from Andrea Tino (20)

PDF
Our Journey: from Waterfall to Agile to DevOps
Andrea Tino
 
PDF
Development & GDPR (v2)
Andrea Tino
 
PDF
Development & GDPR
Andrea Tino
 
PDF
Cutting Edge on Development Methodologies in IT
Andrea Tino
 
PDF
An introduction to DevOps
Andrea Tino
 
PDF
Continuous Everything
Andrea Tino
 
PDF
Modern Trends in UI Decoupling Design
Andrea Tino
 
PDF
Workshop on Cryptography - Frequency Analysis (basic)
Andrea Tino
 
PDF
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
Andrea Tino
 
PDF
Visual Studio Tools for Cordova
Andrea Tino
 
PDF
Microsoft + Agile (light)
Andrea Tino
 
PDF
Microsoft + Agile
Andrea Tino
 
PDF
The World of Stylesheet Languages
Andrea Tino
 
PDF
How to Develop Cross-Platform Apps
Andrea Tino
 
PDF
The Asynchronous Pattern (for beginners)
Andrea Tino
 
PDF
Designing an effective hybrid apps automation framework
Andrea Tino
 
PDF
7 tips for more effective morning SCRUM
Andrea Tino
 
PDF
Powerful tools for building web solutions
Andrea Tino
 
PDF
Working with Agile technologies and SCRUM
Andrea Tino
 
PDF
Creating a compiler for your own language
Andrea Tino
 
Our Journey: from Waterfall to Agile to DevOps
Andrea Tino
 
Development & GDPR (v2)
Andrea Tino
 
Development & GDPR
Andrea Tino
 
Cutting Edge on Development Methodologies in IT
Andrea Tino
 
An introduction to DevOps
Andrea Tino
 
Continuous Everything
Andrea Tino
 
Modern Trends in UI Decoupling Design
Andrea Tino
 
Workshop on Cryptography - Frequency Analysis (basic)
Andrea Tino
 
Master Thesis - A Distributed Algorithm for Stateless Load Balancing
Andrea Tino
 
Visual Studio Tools for Cordova
Andrea Tino
 
Microsoft + Agile (light)
Andrea Tino
 
Microsoft + Agile
Andrea Tino
 
The World of Stylesheet Languages
Andrea Tino
 
How to Develop Cross-Platform Apps
Andrea Tino
 
The Asynchronous Pattern (for beginners)
Andrea Tino
 
Designing an effective hybrid apps automation framework
Andrea Tino
 
7 tips for more effective morning SCRUM
Andrea Tino
 
Powerful tools for building web solutions
Andrea Tino
 
Working with Agile technologies and SCRUM
Andrea Tino
 
Creating a compiler for your own language
Andrea Tino
 
Ad

Recently uploaded (20)

PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Digital Circuits, important subject in CS
contactparinay1
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 

Javascript cheatsheet

  • 1. Variables & types Flow control Functions Javascript basics Andrea Tino This document uses graphic assets from Freepik var name = init-value ; var name ; Variables are used to store values and retrieve them later. They are essential building blocks in every program you will ever write. Javascript supports very basic types: strings and numbers. var str = “hello”; var integer = 10; var decimal = 1.5; var num1 = 1/2; var num2 = num1*2; var myvar = 0; console.log(myvar); code if ( condition ) { } Javascript is a programming language very simple but extremely powerful. It is used by browsers today so that web pages can be interactive and very dynamic. In your favorite browser’s window, hit F12 and bring up the Developer Tools. You can write some Javascript in the console tab to have some fun. Sometimes you ant certain code to be executed, but not always. Conditionals are used to execute code only when one or more conditions are met. Loops (or cycles) are used everytime you want to execute the same code many times. code for (var i=0; i< n ; i++) { } if (1 < 2) { alert(”Hi!”); } for (var i=0; i<10; i++) { console.log(”This is:” + i); } What if you have a piece of code you end up executing many times in different parts of your code? Functions help you modularize and reuse pieces of code that you execute very often in your program. code function name ( args ) { } A function must first be declared: function-name ( args ); Then a function can be invoked: function greetMe (name) { alert(”Hello ” + name); } greetMe (”Batman”);