SlideShare a Scribd company logo
Javascript 3 Loops / For / While / Do..while/  break / continue / for .. in
Javascript Loops In javascript zijn er 2 soorten loops: For Doorloopt een blok code een vooraf bepaalt aantal maalWhileDoorloopt een blok code net zolang totdat een een conditie op true komt.
Javascript Loops De For Loop Syntax for (var=startvalue;var<=endvalue;var=var+increment){code die uitgevoerd wordt}
Javascript Loops De WhileLoop Syntax while (var<=eindwaarde  {   code die uitgevoerd wordt   }
Javascript Loops De Do .. WhileLoop De do .. while loop is een variant op de while loop. De code wordt eenmaal uitgevoerd en herhaalt de loop tot de conditie op waar staat. Syntax do  {  code die uitgevoerd wordt   }while (var<=eindwaard);
Javascript Loops De break Statement De break statement stopt de loop en gaat verder met de code die na de loop komt. (of stopt wanneer er geen code volgt.
Javascript Loops De continue Statement De continue statement stopt de huidige loop en gaat verder de volgende waarde!
Javascript Loops De For .. In Statement De For .. In statement doorloopt een loop van elementen binnen een ‘array’ of de properties van een ‘object’.   Syntax for (variable in object)  {   uittevoeren code  }
Javascript Loops
Opdracht ! Experimenteren met de code !

More Related Content

Viewers also liked

Inleiding Moederborden 2003
Inleiding Moederborden 2003Inleiding Moederborden 2003
Inleiding Moederborden 2003mvanginkel
 
Les 3 php prog 2
Les 3 php prog 2Les 3 php prog 2
Les 3 php prog 2mvanginkel
 
Configuration management
Configuration managementConfiguration management
Configuration management
mvanginkel
 
Herhaling blok 8
Herhaling blok 8Herhaling blok 8
Herhaling blok 8mvanginkel
 
1.4 p font en h-tags_stylen
1.4 p font en h-tags_stylen1.4 p font en h-tags_stylen
1.4 p font en h-tags_stylenmvanginkel
 
Html les 2.3_responsive_design
Html les 2.3_responsive_designHtml les 2.3_responsive_design
Html les 2.3_responsive_design
mvanginkel
 
Functional ruby
Functional rubyFunctional ruby
Functional ruby
Kerry Buckley
 
Jc selecting, sorting, ordering
Jc selecting, sorting, orderingJc selecting, sorting, ordering
Jc selecting, sorting, ordering
Doug Adams
 
Effective Multicultural Communications in Social Media
Effective Multicultural Communications in Social MediaEffective Multicultural Communications in Social Media
Effective Multicultural Communications in Social Media
Alex de Carvalho
 
AZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the EnterpriseAZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the Enterprise
Rawn Shah
 
Fast-buck Britain
Fast-buck BritainFast-buck Britain
Fast-buck Britain
Alan Doherty
 
Face of Scotland
Face of ScotlandFace of Scotland
Face of Scotland
Alan Doherty
 
Apocalypse In Death Valley Another Dream
Apocalypse In Death Valley   Another DreamApocalypse In Death Valley   Another Dream
Apocalypse In Death Valley Another Dream
Dellyo_82
 
Html les 2.2_positioneren
Html les 2.2_positionerenHtml les 2.2_positioneren
Html les 2.2_positionerenmvanginkel
 
Html les 2.1 Forms
Html les 2.1 FormsHtml les 2.1 Forms
Html les 2.1 Forms
mvanginkel
 
HTML module 1 1.8 terugblik
HTML module 1 1.8 terugblikHTML module 1 1.8 terugblik
HTML module 1 1.8 terugblikmvanginkel
 

Viewers also liked (20)

Les 1.4 php
Les 1.4  phpLes 1.4  php
Les 1.4 php
 
Inleiding Moederborden 2003
Inleiding Moederborden 2003Inleiding Moederborden 2003
Inleiding Moederborden 2003
 
Les 1.5 php
Les 1.5  phpLes 1.5  php
Les 1.5 php
 
Les 3 php prog 2
Les 3 php prog 2Les 3 php prog 2
Les 3 php prog 2
 
Les 1 Xml
Les 1 XmlLes 1 Xml
Les 1 Xml
 
Configuration management
Configuration managementConfiguration management
Configuration management
 
Herhaling blok 8
Herhaling blok 8Herhaling blok 8
Herhaling blok 8
 
1.4 p font en h-tags_stylen
1.4 p font en h-tags_stylen1.4 p font en h-tags_stylen
1.4 p font en h-tags_stylen
 
Html les 2.3_responsive_design
Html les 2.3_responsive_designHtml les 2.3_responsive_design
Html les 2.3_responsive_design
 
Functional ruby
Functional rubyFunctional ruby
Functional ruby
 
Jc selecting, sorting, ordering
Jc selecting, sorting, orderingJc selecting, sorting, ordering
Jc selecting, sorting, ordering
 
Effective Multicultural Communications in Social Media
Effective Multicultural Communications in Social MediaEffective Multicultural Communications in Social Media
Effective Multicultural Communications in Social Media
 
AZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the EnterpriseAZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the Enterprise
 
Fast-buck Britain
Fast-buck BritainFast-buck Britain
Fast-buck Britain
 
Face of Scotland
Face of ScotlandFace of Scotland
Face of Scotland
 
Apocalypse In Death Valley Another Dream
Apocalypse In Death Valley   Another DreamApocalypse In Death Valley   Another Dream
Apocalypse In Death Valley Another Dream
 
Html les 2.2_positioneren
Html les 2.2_positionerenHtml les 2.2_positioneren
Html les 2.2_positioneren
 
Html les 2.1 Forms
Html les 2.1 FormsHtml les 2.1 Forms
Html les 2.1 Forms
 
HTML module 1 1.8 terugblik
HTML module 1 1.8 terugblikHTML module 1 1.8 terugblik
HTML module 1 1.8 terugblik
 
1.1 basis
1.1 basis1.1 basis
1.1 basis
 

Les 3 javascript

  • 1. Javascript 3 Loops / For / While / Do..while/ break / continue / for .. in
  • 2. Javascript Loops In javascript zijn er 2 soorten loops: For Doorloopt een blok code een vooraf bepaalt aantal maalWhileDoorloopt een blok code net zolang totdat een een conditie op true komt.
  • 3. Javascript Loops De For Loop Syntax for (var=startvalue;var<=endvalue;var=var+increment){code die uitgevoerd wordt}
  • 4. Javascript Loops De WhileLoop Syntax while (var<=eindwaarde  {   code die uitgevoerd wordt   }
  • 5. Javascript Loops De Do .. WhileLoop De do .. while loop is een variant op de while loop. De code wordt eenmaal uitgevoerd en herhaalt de loop tot de conditie op waar staat. Syntax do  {  code die uitgevoerd wordt   }while (var<=eindwaard);
  • 6. Javascript Loops De break Statement De break statement stopt de loop en gaat verder met de code die na de loop komt. (of stopt wanneer er geen code volgt.
  • 7. Javascript Loops De continue Statement De continue statement stopt de huidige loop en gaat verder de volgende waarde!
  • 8. Javascript Loops De For .. In Statement De For .. In statement doorloopt een loop van elementen binnen een ‘array’ of de properties van een ‘object’. Syntax for (variable in object)  {   uittevoeren code  }
  • 10. Opdracht ! Experimenteren met de code !