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
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Digital Circuits, important subject in CS
contactparinay1
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 

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”);