← All projects/3 - The fundamentals/Javascript Introduction - Loops & Iterators

Guide: Javascript Introduction - Loops & Iterators

Description

👉 This guide is part of the Javascript Introduction Guides. Please follow the order:

  • Fundamentals & Data Types
  • Conditionals
  • Loops & Iterators
  • Functions
  • ES6

 

Loop statements are very important in any programming language. They will allow us to easily create actions that will be applied to dozens, thousands and even millions of times with a few lines of code. They also help in searching for things and much more. In this Guide you will learn how Javascript deals with Loops and Iterators.

Knowledge

  • Understand what are loops and iterators

Skills

  • Be able to use loops and iterators to create lists

Topics

  • Loops & Iterators
    • For loop
      • Reverse loop
    • While loop
      • Break
    • Object
      • for...in

Action Points

  • Read up on loops and iterators in Javascript
  • Find out what is an infinite loop
  • Find out what is the difference between a loop and an iterator

Deliverable: Exercise solution

  • Submit:
    • Repl.it Project URL (Javascript Repl)
    • Add comments for each relevant code block
  • Exercise description
    • Get the randomized data: https://my.api.mockaroo.com/people_json.json?key=632d7f80 and transform it into an array in a Javascript file
    • Create a Javascript file that, using console.log():
      • Outputs how many children all people have together
      • Outputs one string per person formatted as such:
        • <Name>: <Age>
      • Using for...in output all properties of all people
    • Use a title/explanation for each part
    • Showing results via DOM manipulation is not required but is welcome and would replace the use of console.log()