SlideShare a Scribd company logo
1 of 30
Download to read offline
JavaScript
For Beginners
@paal_ringstad
http://jsbin.com/?
LINKS
Your Toolbox
Data types
# numbers
$ strings
❓ booleans
& objects
(' null)
(( undefined)
Statements
Storage
Variables
Constants
Operators
&&, ||, !
Operations
Methods /
Functions
Conditions (if,
else, else if)
Loops (for, while)
Conditions?
(if, else if, else)
and = &&
opposite of true = !
Loops?
For, While
for
while
Arrays
students[0] = “Julie"
students[1] = “Ben”
students[2] = “Beatrice”
a l p h a b e t
0 1 2 3 4 5 6 7
var word = “alphabet”
word[0] = a
word[3] = h
word[7] = t
.trim
.length
Methods
Example "
Console.log();
=
Print to the screen
PSEUDOCODE
from here to here?
How will I GO
Can you explain how to put socks
on to someone who’s never put
socks on -
The sock example
Pseudocode’s philosophy
“Nothing is particularly hard if you
divide it into small jobs.”
– Henry Ford
Create an if statement
that will print out:
“If you are hungry and
thirsty, then drink & eat”
Exercise +,
Print out the numbers 1 to
8 using a for loop
Exercise ∞
Print out 5 times “Hey”
using a while loop.
Exercise .
Create this string variable:
var animal = “elephant”;
Then print out the
characters “p” & “t” of that
string
Exercise /
Print out the first element of
this array.
Exercise 0
Print out the first letter of the first
element of this array.
Exercise #
Print out the second element of this
array after having checked if it
started with a “B” by using an if
statement.
Exercise 1
Print out all names of this array by
using a for loop.
Exercise 2
Combine all you just learned to print
out all names that starts with a “B”.
You must use a for loop and an if
statement.
Exercise 3
Create a function that prints all students
names (on one line) that start with a specific
letter. The function takes two parameters:
1) An array of students 2) A letter
Exercise 4
Create a Dating “App” using a
function that takes 2 or more
arguments (hobbies / age / IQ…).
The function will tell you whether
this is a good match for you 5
Exercise 6
Brings technical skills
to creative people
Thank you for
joining us!
@paal_ringstad
JavaScript
For Beginners
@paal_ringstad

More Related Content

Similar to JavaScript for Beginners guide with data types, variables, loops & functions

Preexisting code, please useMain.javapublic class Main { p.pdf
Preexisting code, please useMain.javapublic class Main {    p.pdfPreexisting code, please useMain.javapublic class Main {    p.pdf
Preexisting code, please useMain.javapublic class Main { p.pdfrd1742
 
Brixton Library Technology Initiative Week1 Recap
Brixton Library Technology Initiative Week1 RecapBrixton Library Technology Initiative Week1 Recap
Brixton Library Technology Initiative Week1 RecapBasil Bibi
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basicsrobertbenard
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basicsrobertbenard
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review GuideBenjamin Kissinger
 
Programming with Java: the Basics
Programming with Java: the BasicsProgramming with Java: the Basics
Programming with Java: the BasicsJussi Pohjolainen
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2Ruth Marvin
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrayssshhzap
 
Write codeforhumans
Write codeforhumansWrite codeforhumans
Write codeforhumansNarendran R
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Courseparveen837153
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Ahmed Gad
 
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014hwilming
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years AgoScott Wlaschin
 
Testing With Test::Class
Testing With Test::ClassTesting With Test::Class
Testing With Test::ClassCurtis Poe
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingKeshav Kumar
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingKeshav Kumar
 
Uses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & StubsUses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & StubsPatchSpace Ltd
 

Similar to JavaScript for Beginners guide with data types, variables, loops & functions (20)

Preexisting code, please useMain.javapublic class Main { p.pdf
Preexisting code, please useMain.javapublic class Main {    p.pdfPreexisting code, please useMain.javapublic class Main {    p.pdf
Preexisting code, please useMain.javapublic class Main { p.pdf
 
Brixton Library Technology Initiative Week1 Recap
Brixton Library Technology Initiative Week1 RecapBrixton Library Technology Initiative Week1 Recap
Brixton Library Technology Initiative Week1 Recap
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basics
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basics
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review Guide
 
Programming with Java: the Basics
Programming with Java: the BasicsProgramming with Java: the Basics
Programming with Java: the Basics
 
Intro to Java
Intro to JavaIntro to Java
Intro to Java
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2
 
Writing tests
Writing testsWriting tests
Writing tests
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrays
 
Write codeforhumans
Write codeforhumansWrite codeforhumans
Write codeforhumans
 
Pythonintro
PythonintroPythonintro
Pythonintro
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Course
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
 
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
 
Testing With Test::Class
Testing With Test::ClassTesting With Test::Class
Testing With Test::Class
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programming
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programming
 
Uses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & StubsUses & Abuses of Mocks & Stubs
Uses & Abuses of Mocks & Stubs
 

More from Paal Ringstad

Command cheatsheets windows
Command cheatsheets windowsCommand cheatsheets windows
Command cheatsheets windowsPaal Ringstad
 
Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets macPaal Ringstad
 
JS - ES6 Javascript for Beginners
JS - ES6 Javascript for BeginnersJS - ES6 Javascript for Beginners
JS - ES6 Javascript for BeginnersPaal Ringstad
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbournePaal Ringstad
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon MelbournePaal Ringstad
 
HTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon BootcampHTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon BootcampPaal Ringstad
 
HTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon BootcampHTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon BootcampPaal Ringstad
 

More from Paal Ringstad (8)

Command cheatsheets windows
Command cheatsheets windowsCommand cheatsheets windows
Command cheatsheets windows
 
Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets mac
 
Ruby for Beginners
Ruby for BeginnersRuby for Beginners
Ruby for Beginners
 
JS - ES6 Javascript for Beginners
JS - ES6 Javascript for BeginnersJS - ES6 Javascript for Beginners
JS - ES6 Javascript for Beginners
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon Melbourne
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
HTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon BootcampHTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon Bootcamp
 
HTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon BootcampHTML & CSS - Le Wagon Bootcamp
HTML & CSS - Le Wagon Bootcamp
 

Recently uploaded

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 

Recently uploaded (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 

JavaScript for Beginners guide with data types, variables, loops & functions