1 / 16

JavaScript Loops | JavaScript Loops Examples | JavaScript Tutorial For Beginners | Simplilearn

In this JavaScript presentation, we learn all about loops. Loops are the basic programming construct that execute a piece of code repetitively as long as a particular condition is satisfied. <br><br>This presentation on JavaScript loops include the following topics: <br>1. What are loops?<br>2. For loop<br>3. While loop<br>4. Do-while loop<br>5. Breaking out of a loop<br>6. Skipping a loop cycle<br><br><br>This JavaScript Certification course helps you master the JavaScript programming language in an all-inclusive training program that includes complete JavaScript fundamentals, jQuery, Ajax, and more. You will apply your skills by building a real-time chat application.<br><br>JavaScript Course Overview:<br>This training program entails the fundamentals of JavaScript, including the enumeration and elaboration of various data types in JavaScript, an explanation of loops and conditional statements in JavaScript, and an overview of the concepts of objects and variables in JavaScript.<br><br>JavaScript Certification Key Features<br>1. 100% Money Back Guarantee<br>2. 7 complete JavaScript courses<br>3. Covers Ajax, jQuery, and node.js<br>4. Build a real-time chat application<br>5. Course completion certificate<br><br>ud83dudc49Learn more at: https://bit.ly/2SDfYlR

Simplilearn
Download Presentation

JavaScript Loops | JavaScript Loops Examples | JavaScript Tutorial For Beginners | Simplilearn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What’s in it for you? • For loop • While loop • Breaking out of a loop • Skipping a loop cycle

  2. What is a loop? A loop is a programming construct that executes a piece of code as long as a certain condition is met Loops Exit controlled Entry controlled

  3. Click here to watch the video

  4. For loop

  5. For loop start Increase n by 1 for n= 0 to 9 Print “Looping” 0<n<10 n>10 end

  6. For loop Counter variable – Keeps track of how many times the code has been executed Counter variable increment Usually +1 for(i=0; i<5; i++) Condition code – Keeps looping until the condition is met

  7. While loop

  8. While loop start while(condition) Execute code true false end

  9. While loop The variable is the value that will change while (variable < endingCondition) Maximum value a variable can reach

  10. Do - while loop start Execute code while(condition) true false end

  11. Breaking out of a loop

  12. Breaking out of loop Break is used to break out of a loop for(i=1;i<=10;i++) { document.write ( i + “is the current number) if( i==5 ){ break; } }

  13. Skipping a loop cycle

  14. Skipping a loop cycle To skip a particular loop, continue is used for(i=1;i<=10;i++) { if( i==3 ){ continue; } document.write ( i + “is the current number) }

More Related