dev1 – JS Basics, Control Flow

Tutorials

  • Section 09, videos 079 – 092
  • 09 JS Basics – Control Flow tutorial notes
  • Exercise files to publish on your server as HTML/JS pairs:
    • bouncer.html / bouncer.js
    • age-exercise.html / age-exercise.js
    • number-guess.html / number-guess.js
    • while-loops.html / while-loops.js
    • annoy-o-matic.html / annoy-o-matic.js
    • for-loops.html / for-loops.js

Blog Questions

Use the code insert tool and provide examples to answer these two questions. Use JS comment syntax to describe your example.

  • How can you use “falsey-ness” to determine if a string value can be coerced to a number? Why does this work? What is “type coercion” anyway?
  • What do you need to do to convert a for loop to a while loop?
// Here's my description in a JS Comment
// Here's some more!!
// Below is my code...
var num = 0
for(var i = 0; i <= 9; i++){
    num+=i
}
console.log(num)

Leave a comment

Your email address will not be published. Required fields are marked *

css.php