Skip to content

upperlinecode/loopy-math-javascript-iteration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loopy Math

Welcome!

Instructions for cloning down this repository to an IDE (coding environment):

  1. Above the list of files, click on the Code button.
  2. Copy the URL of the repository.
  3. If you are using Repl.it:
    • Select the + Create Repl button on the top left corner of the web page.
    • In the pop up window, select the Import from GitHub button
    • Paste the GitHub URL and click on the button Import from GitHub.

Note: If you are coding along with the video, we suggest you open the video in a window on the left and your code in a window on the right. This method of coding along is called "split screen".

Contents

  1. Intro
  2. The Lab
  3. Getting Started

Intro

Pandas Looping Through a Slide

Javascript can be used to make mathematical tasks much less... well... mathy. In this lab, you will use for loops to compute some math challenges without having to add hundreds of numbers by hand.

The Lab

Loops in javascript allow us to automate processes that would be tedious and exhausting otherwise.

For example: Without loops, printing 100 different numbers would take 100 lines of code. With loops, we can do it in 3 lines of code. More impressively, we can bump that number up to 10,000, or even into the millions and billions without having to add extra lines of code!

Open up the loops.js file, and try to complete each of the for loop challenges described there (written as javascript comments). Run the code after each new loop you write to see if your code works as intended. Before moving on to the next challenge, make sure to comment out all previous code. Many of the challenges can be done in at least two ways, and some can be done in ad many as 10 ways! As long as your output meets the criteria for each challenge, you're doing a great job!

Need a challenge? There are stretch activities built right into this lab!

Getting Started

Not sure where to start? Take a look at the example below...

Example: Code a for loop that prints every number from 0 to 2.

for(let i = 0; i <= 2; i++) {
  console.log(i)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages