Objects and Review
Homework
- Objects
- Review of everything in 262 so far.
Morning reflection
Housekeeping
- CPNT 262 Assignment 2
- Optional Saturday sessions
- Tutor sessions
- Pro-tips and out-of-scope material
- 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
- 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
- Assignment 2
- Portfolio things (Final Presentations -> 2 months away!)
- 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.