Repository navigation
Session 3
Monica Kay edited this page Dec 3, 2021
·
2 revisions
- introduce basic syntax and structure of
switchstatement - reassign variable value in different cases
- set
defaultcase - discuss how
switchstatements differ fromif...elsestatements
- introduce basic syntax and structure of
for...ofloop - discuss how
forloops differ fromfor...ofloops - use
for...ofloops to iterate through an array and access each object within it - for each object in an array, use dot notation to access the values of specific properties
- iterate through collections of objects using
for...ofloop - iterate over an array of objects, generating string representations of each one by interpolating its property values into a string
- append each string to the existing value of a variable using the addition assignment operator:
+= - use dot notation to add a new property to each object in an array, and the assignment operator to assign value to it.
- review function parameters and arguments
- review arrow function syntax
- discuss the difference between invoking a function and defining it
- capture the return value in a variable
- discuss
undefinedand how it is related to thereturnkeyword