Objects and Review

Homework

  1. Objects
  2. Review of everything in 262 so far.

Morning reflection

Housekeeping

  1. CPNT 262 Assignment 2
  2. Optional Saturday sessions
    • Tutor sessions
    • Pro-tips and out-of-scope material
  3. Dailies shoutouts

1. Object fundamentals

Learning Objectives

  • Explore the different ways to initialize objects.
  • Access a property in an object using dot notation.
  • Re-assign an item in an object using dot notation.

Terminology

Object
A collection of name/value pairs (in terms of Javascript)
Object Literal
An object literally coded using proper object notation.
Object Property
A fancy term for a name/value pair where the value is anything but a function.
Object Method
A fancy term for name/value pair where the value is a function.

Materials

Key Takeaways

  • Much like flexboxes and grids, arrays and objects can be nested inside each other.
  • Object properties are for nouns, methods (aka. functions) are for verbs.

2. Course Review

Learning Objectives

  • Revisit the relationship between the Javascript runtime and the environment it runs in.
    • DOM things (example: document.things)
    • Core modules (example: Math.things)
  • Revisit the Javascript data types covered until this point.
    • primitive types
      • undefined
      • null
      • number
      • string
      • boolean
    • complex types
      • array
      • object
    • coercion
    • control structures
      • comparison operators
      • conditional statements
  • Build a literal JS object of a thing of your choice. Incorporate each of the following data types:
    • number
    • string
    • array
    • nested object
    • null
  • Use a conditional statement to output a message (either to the console or an HTML page) that changes based on your object properties.

Materials


Open lab-time

  1. Assignment 2
  2. Portfolio things (Final Presentations -> 2 months away!)
  3. Homework for Tuesday

Tony’s goals for Lab-Time

  • Terminology data structure

Dailies

  • Submit today’s Codepen/repo/gist to the Dailies section (in Assessments) in Brightspace.