SlideShare a Scribd company logo
Javascript 3Loops / For / While / Do..while/ break / continue / for .. in
Javascript LoopsIn 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 LoopsDe For LoopSyntaxfor (var=startvalue;var<=endvalue;var=var+increment){code die uitgevoerd wordt}
Javascript LoopsDe WhileLoopSyntaxwhile (var<=eindwaarde  {   code die uitgevoerd wordt   }
Javascript LoopsDe Do .. WhileLoopDe 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.Syntaxdo  {  code die uitgevoerd wordt   }while (var<=eindwaard);
Javascript LoopsDe break StatementDe break statement stopt de loop en gaat verder met de code die na de loop komt. (of stopt wanneer er geen code volgt.
Javascript LoopsDe continue StatementDe continue statement stopt de huidige loop en gaat verder de volgende waarde!
Javascript LoopsDe For .. In StatementDe For .. In statement doorloopt een loop van elementen binnen een ‘array’ of de properties van een ‘object’.  Syntaxfor (variable in object)  {   uittevoeren code  }
Javascript Loops
Opdracht !Experimenteren met de code !

More Related Content

PPTX
Les 3 javascript
PPT
For each
PPT
The Church Of My Grandmother’S Village
PPT
PPT
Greatest Films
PDF
What's Next in Growth? 2016
PDF
The Six Highest Performing B2B Blog Post Formats
PDF
The Outcome Economy
Les 3 javascript
For each
The Church Of My Grandmother’S Village
Greatest Films
What's Next in Growth? 2016
The Six Highest Performing B2B Blog Post Formats
The Outcome Economy
Ad

Les 3 Javascript