Prev
Monday, Feb 12
CPNT 262 - Day 06
Next
Morning Activity: Plan out an App feature
Choose from one of the following:accordion toggle
carousel
dark mode toggle
mobile nav menu
pseudocode how you assume this should workstart with your current knowledge of js
step through each phase as you view them
Note unknowns for practicepay attention to what you didn’t know how to do
research into behaviours that seem unfamiliar
Adjust pseudocode to reflect new knowledge
Creating a proof of concept of this will be your afternoon activity
1. Statements vs Expressions
Key Takeaways
statements contain expressions
if a chunk of js returns undefined, it’s a statement (otherwise it’s an expression)
all the operators we’ve covered are functions that return values —> expressions
Events
VIDEO
Activity
Create 2 functions that log different things to the console
connect 1 to a button using an event listener
connect 1 to a button using onclick
3. matchMedia and classListToggle
classList
mdn documentation
used to change and manipulate an html elements css classes
useful especially for darkmode and other such features
Syntax and Concept Review
string, array, object, or Math methods
Manipulating things with functions
Variables and displaying them on an html page
Demonstrations
finished example : Responsive Navigation follow up with things we’ve started
demo using matchMedia and classList
Today's Achievement
Lab Activity: Code your feature from this morning
Working from your pseudocode, create a minimal implementation of the code you planned
Use a test repo (not a part of a project or anything)
Prior to writing code, document your primary goal (and avoid deviating too much)
Try to build itavoid using chatGPT for direct code generation, as clarifying questions etc, but make sure that you are the one coming up with the scripts
Submit your repo or codepen to the dailies dropbox for today at the end of lab