SlideShare a Scribd company logo
JavaScript
Iterations
Charles Russell
Bennu Bird Media
Changes in Direction
●
In the previous video we allowed our program to
change flow to one of many different program
blocks
●
But that is not the only direction change we may
want. It is often desireable to repeatedly execute
the same block
●
Looking for some value in a list
●
Sending a group email
●
In other words we want to loop
The While loop
●
At the top of the loop the condition is checked
●
If the condition is met then execute code block
●
Loop will continue until condition not met.
while (conditional expression) {
//Do some stuff
}
●
Be sure that eventually the condition will not be
met otherwise you get an infinite loop;
The Do loop
●
At the bottom of the loop condition is checked
●
Assures the code block will be executed at least
once
●
Loop continues until condition false
do {
//code to execute goes here
} while (conditional expression);
Basic For loop
●
Executes the loop a number of times
●
Has three statements
●
First excutes before the loop is executed
– Usually used for initialization
●
Second conditional expression
– Code executes if true
●
Third
– Executes after the code block before the next
iteration
Basic For Syntax
for (init ; conditional exp; prepForNext) {
//do some stuff
}
For looping through
properties
●
Used to examine properties of an object
●
Important to filter as all properties examined
even those inherited from parent and its
parent....
for (variable in Object) {
if ( Object.hasOwnProperty(variable) {
//code to execute
}
}
Cutting the loop
●
break
●
Halts code execution in the loop
– Stop further execution of code block and exit the
loop
●
continue
●
Halts execution of the rest of the code block
●
Continues next iteration
Summary
●
Iteration is another word for looping
●
While loops check for conditional at the top of
the loop
●
Be wary of the infinite loop
●
Do loops check conditional at bottom of the loop
●
Basic for loops allow loops to be controlled by
number of executions
●
For in loops will check properties of Objects and
Arrays
●
Be sure to use hasOwnProperty method.
Next: Live Code

More Related Content

What's hot

Presenter kn
Presenter knPresenter kn
Presenter kn
ogomr
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
TO THE NEW | Technology
 
While , For , Do-While Loop
While , For , Do-While LoopWhile , For , Do-While Loop
While , For , Do-While Loop
Abhishek Choksi
 
JAVA Threads explained
JAVA Threads explained JAVA Threads explained
JAVA Threads explained
Pradhan Rishi Sharma
 
A tale of two(many) proxies
A tale of two(many) proxiesA tale of two(many) proxies
A tale of two(many) proxies
Mohan Dutt
 
Modern Programming Languages - An overview
Modern Programming Languages - An overviewModern Programming Languages - An overview
Modern Programming Languages - An overview
Ayman Mahfouz
 
Exploring reactive programming with Java
Exploring reactive programming with JavaExploring reactive programming with Java
Exploring reactive programming with Java
Miro Cupak
 
Java Control Statements
Java Control StatementsJava Control Statements
Java Control Statements
KadarkaraiSelvam
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii Shapoval
GlobalLogic Ukraine
 
JS knowing-nuances
JS knowing-nuancesJS knowing-nuances
JS knowing-nuances
Ramesh Ramalingam
 
Loop control structure
Loop control structureLoop control structure
Loop control structure
narmadhakin
 
Best practices for unit testing RxJava
Best practices for unit testing RxJavaBest practices for unit testing RxJava
Best practices for unit testing RxJava
Simon Percic
 
Practical introduction to the actor model
Practical introduction to the actor modelPractical introduction to the actor model
Practical introduction to the actor model
Georgios Gousios
 
For
ForFor
Reactive programming in Java
Reactive programming in JavaReactive programming in Java
Reactive programming in Java
Miro Cupak
 
Ratpack JVM_MX Meetup February 2016
Ratpack JVM_MX Meetup February 2016Ratpack JVM_MX Meetup February 2016
Ratpack JVM_MX Meetup February 2016
Domingo Suarez Torres
 
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
Huda Alameen
 
Groovy MOPping
Groovy MOPpingGroovy MOPping
Groovy MOPping
Izzet Mustafaiev
 
Dangers of parallel streams
Dangers of parallel streamsDangers of parallel streams
Dangers of parallel streams
Lukáš Křečan
 
Computer programming 2 Lesson 8
Computer programming 2  Lesson 8Computer programming 2  Lesson 8
Computer programming 2 Lesson 8
MLG College of Learning, Inc
 

What's hot (20)

Presenter kn
Presenter knPresenter kn
Presenter kn
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
 
While , For , Do-While Loop
While , For , Do-While LoopWhile , For , Do-While Loop
While , For , Do-While Loop
 
JAVA Threads explained
JAVA Threads explained JAVA Threads explained
JAVA Threads explained
 
A tale of two(many) proxies
A tale of two(many) proxiesA tale of two(many) proxies
A tale of two(many) proxies
 
Modern Programming Languages - An overview
Modern Programming Languages - An overviewModern Programming Languages - An overview
Modern Programming Languages - An overview
 
Exploring reactive programming with Java
Exploring reactive programming with JavaExploring reactive programming with Java
Exploring reactive programming with Java
 
Java Control Statements
Java Control StatementsJava Control Statements
Java Control Statements
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii Shapoval
 
JS knowing-nuances
JS knowing-nuancesJS knowing-nuances
JS knowing-nuances
 
Loop control structure
Loop control structureLoop control structure
Loop control structure
 
Best practices for unit testing RxJava
Best practices for unit testing RxJavaBest practices for unit testing RxJava
Best practices for unit testing RxJava
 
Practical introduction to the actor model
Practical introduction to the actor modelPractical introduction to the actor model
Practical introduction to the actor model
 
For
ForFor
For
 
Reactive programming in Java
Reactive programming in JavaReactive programming in Java
Reactive programming in Java
 
Ratpack JVM_MX Meetup February 2016
Ratpack JVM_MX Meetup February 2016Ratpack JVM_MX Meetup February 2016
Ratpack JVM_MX Meetup February 2016
 
Java Repetiotion Statements
Java Repetiotion StatementsJava Repetiotion Statements
Java Repetiotion Statements
 
Groovy MOPping
Groovy MOPpingGroovy MOPping
Groovy MOPping
 
Dangers of parallel streams
Dangers of parallel streamsDangers of parallel streams
Dangers of parallel streams
 
Computer programming 2 Lesson 8
Computer programming 2  Lesson 8Computer programming 2  Lesson 8
Computer programming 2 Lesson 8
 

Viewers also liked

JavaScript Tools and Implementation
JavaScript Tools and ImplementationJavaScript Tools and Implementation
JavaScript Tools and Implementation
Charles Russell
 
JavaScript Introductin to Functions
JavaScript Introductin to FunctionsJavaScript Introductin to Functions
JavaScript Introductin to Functions
Charles Russell
 
JavaScript Comments and Conditionals
JavaScript Comments and ConditionalsJavaScript Comments and Conditionals
JavaScript Comments and Conditionals
Charles Russell
 
Javascript built in String Functions
Javascript built in String FunctionsJavascript built in String Functions
Javascript built in String Functions
Avanitrambadiya
 
Boom Boom! Revolution Press Kit
Boom Boom! Revolution Press KitBoom Boom! Revolution Press Kit
Boom Boom! Revolution Press Kit
Boom Boom! Cards
 
Designing Websites in Photoshop
Designing Websites in PhotoshopDesigning Websites in Photoshop
Designing Websites in Photoshop
Brunner
 
XML
XMLXML
Open Source Software
Open Source SoftwareOpen Source Software
Open Source Software
Charles Russell
 
Js objects
Js objectsJs objects
Js objects
Charles Russell
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
Charles Russell
 
Creating simple web design in photoshop
Creating simple web design in photoshopCreating simple web design in photoshop
Creating simple web design in photoshop
lillianabe
 
JavaScript Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
Charles Russell
 
JavaScript Variables
JavaScript VariablesJavaScript Variables
JavaScript Variables
Charles Russell
 
Javascript - Break statement, type conversion, regular expression
Javascript - Break statement, type conversion, regular expressionJavascript - Break statement, type conversion, regular expression
Javascript - Break statement, type conversion, regular expression
Shivam gupta
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
Charles Russell
 

Viewers also liked (15)

JavaScript Tools and Implementation
JavaScript Tools and ImplementationJavaScript Tools and Implementation
JavaScript Tools and Implementation
 
JavaScript Introductin to Functions
JavaScript Introductin to FunctionsJavaScript Introductin to Functions
JavaScript Introductin to Functions
 
JavaScript Comments and Conditionals
JavaScript Comments and ConditionalsJavaScript Comments and Conditionals
JavaScript Comments and Conditionals
 
Javascript built in String Functions
Javascript built in String FunctionsJavascript built in String Functions
Javascript built in String Functions
 
Boom Boom! Revolution Press Kit
Boom Boom! Revolution Press KitBoom Boom! Revolution Press Kit
Boom Boom! Revolution Press Kit
 
Designing Websites in Photoshop
Designing Websites in PhotoshopDesigning Websites in Photoshop
Designing Websites in Photoshop
 
XML
XMLXML
XML
 
Open Source Software
Open Source SoftwareOpen Source Software
Open Source Software
 
Js objects
Js objectsJs objects
Js objects
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
 
Creating simple web design in photoshop
Creating simple web design in photoshopCreating simple web design in photoshop
Creating simple web design in photoshop
 
JavaScript Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
 
JavaScript Variables
JavaScript VariablesJavaScript Variables
JavaScript Variables
 
Javascript - Break statement, type conversion, regular expression
Javascript - Break statement, type conversion, regular expressionJavascript - Break statement, type conversion, regular expression
Javascript - Break statement, type conversion, regular expression
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
 

Similar to JavaScript iteration

Programming in python - Week 4
Programming in python  - Week 4Programming in python  - Week 4
Programming in python - Week 4
Priya Nayak
 
Loop in C Properties & Applications
Loop in C Properties & ApplicationsLoop in C Properties & Applications
Loop in C Properties & Applications
Emroz Sardar
 
dizital pods session 5-loops.pptx
dizital pods session 5-loops.pptxdizital pods session 5-loops.pptx
dizital pods session 5-loops.pptx
VijayKumarLokanadam
 
C language 2
C language 2C language 2
C language 2
Arafat Bin Reza
 
Loop structures
Loop structuresLoop structures
Loop structures
tazeem sana
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
ChaAstillas
 
Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
aprilyyy
 
Phasers to stunning
Phasers to stunningPhasers to stunning
Phasers to stunning
Simon Proctor
 
Multithreading programming in java
Multithreading programming in javaMultithreading programming in java
Multithreading programming in java
Elizabeth alexander
 
Concurrency
ConcurrencyConcurrency
Concurrency
Isaac Liao
 
1660213363910.pdf
1660213363910.pdf1660213363910.pdf
1660213363910.pdf
CuentaTemporal4
 
Chapter 12 Computer Science ( ICS 12).pdf
Chapter 12 Computer Science ( ICS 12).pdfChapter 12 Computer Science ( ICS 12).pdf
Chapter 12 Computer Science ( ICS 12).pdf
AamirShahzad527024
 
Loops in C.pptx
Loops in C.pptxLoops in C.pptx
Loops in C.pptx
nagalakshmig4
 
Using loops
Using loopsUsing loops
Using loops
nicky_walters
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
deekshagopaliya
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
deekshagopaliya
 
R loops
R   loopsR   loops
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
Rj Baculo
 
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
Igalia
 

Similar to JavaScript iteration (20)

Programming in python - Week 4
Programming in python  - Week 4Programming in python  - Week 4
Programming in python - Week 4
 
Loop in C Properties & Applications
Loop in C Properties & ApplicationsLoop in C Properties & Applications
Loop in C Properties & Applications
 
dizital pods session 5-loops.pptx
dizital pods session 5-loops.pptxdizital pods session 5-loops.pptx
dizital pods session 5-loops.pptx
 
C language 2
C language 2C language 2
C language 2
 
Loop structures
Loop structuresLoop structures
Loop structures
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
 
Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Loops in c++ programming language
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
 
Phasers to stunning
Phasers to stunningPhasers to stunning
Phasers to stunning
 
Multithreading programming in java
Multithreading programming in javaMultithreading programming in java
Multithreading programming in java
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
1660213363910.pdf
1660213363910.pdf1660213363910.pdf
1660213363910.pdf
 
Chapter 12 Computer Science ( ICS 12).pdf
Chapter 12 Computer Science ( ICS 12).pdfChapter 12 Computer Science ( ICS 12).pdf
Chapter 12 Computer Science ( ICS 12).pdf
 
Loops in C.pptx
Loops in C.pptxLoops in C.pptx
Loops in C.pptx
 
Using loops
Using loopsUsing loops
Using loops
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
 
Looping in c++
Looping in c++Looping in c++
Looping in c++
 
R loops
R   loopsR   loops
R loops
 
Cpp loop types
Cpp loop typesCpp loop types
Cpp loop types
 
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
ARB_gl_spirv implementation in Mesa: status update (XDC 2018)
 

Recently uploaded

[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
ukwwuq
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
AanSulistiyo
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
saathvikreddy2003
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 

Recently uploaded (20)

[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 

JavaScript iteration

  • 2. Changes in Direction ● In the previous video we allowed our program to change flow to one of many different program blocks ● But that is not the only direction change we may want. It is often desireable to repeatedly execute the same block ● Looking for some value in a list ● Sending a group email ● In other words we want to loop
  • 3. The While loop ● At the top of the loop the condition is checked ● If the condition is met then execute code block ● Loop will continue until condition not met. while (conditional expression) { //Do some stuff } ● Be sure that eventually the condition will not be met otherwise you get an infinite loop;
  • 4. The Do loop ● At the bottom of the loop condition is checked ● Assures the code block will be executed at least once ● Loop continues until condition false do { //code to execute goes here } while (conditional expression);
  • 5. Basic For loop ● Executes the loop a number of times ● Has three statements ● First excutes before the loop is executed – Usually used for initialization ● Second conditional expression – Code executes if true ● Third – Executes after the code block before the next iteration
  • 6. Basic For Syntax for (init ; conditional exp; prepForNext) { //do some stuff }
  • 7. For looping through properties ● Used to examine properties of an object ● Important to filter as all properties examined even those inherited from parent and its parent.... for (variable in Object) { if ( Object.hasOwnProperty(variable) { //code to execute } }
  • 8. Cutting the loop ● break ● Halts code execution in the loop – Stop further execution of code block and exit the loop ● continue ● Halts execution of the rest of the code block ● Continues next iteration
  • 9. Summary ● Iteration is another word for looping ● While loops check for conditional at the top of the loop ● Be wary of the infinite loop ● Do loops check conditional at bottom of the loop ● Basic for loops allow loops to be controlled by number of executions ● For in loops will check properties of Objects and Arrays ● Be sure to use hasOwnProperty method.