November 1, 2022: Javascript 2

Discussion

Link
shared by
Taichi

In-Class Demo

Notes

This contains a .js file with comments that you can read for explanations.
You can also see the code in the demo-library, as Demo #15.

Review

Declaring a variable
  • Boolean —  var leapYear = false
  • Number — var year = 2021
  • String — var month = November
Re-assigning (changing) a variable
  • year = 2022
Operations
  • Expressions
  • Expressions that evaluate to a boolean
  • month == 'November' evaluates to true
  • Expressions that evaluate to a number
  • 2022 + 1 evaluates to 2023
  • Expressions that evaluate to a string

  • Next Week
Learning
  • Review
  • Date
  • What really are objects?
  • Logic (if/then, and/or)


Possible ideas:
  • Create a page that is like an oracle or a fortune-teller, but it’s really just randomness.
  • Create a page that gives you a random link to another page on your website, or on the internet.
  • Create a page that displays something different depending on the day (Monday, Tuesday, etc.)

Upload to Canvas
Upload it to Github and add the link below! I have to start having something to grade.