CPNT 262 Day 4 - Function fundamentals

Housekeeping

Goals of the day


1. Spoiler demo: String methods


2. Defining and invoking functions

Knowledge of functions is a key skill in software development, especially in Javascript. An important concept to understand is that code inside a function is not run when a function is defined; only when the function is invoked.

Materials

Activity


3. Arguments and parameters

A core goal of programming is to write DRY (Do Not Repeat yourself) code. In this session, we will remove repetitive code with the use of functions.

Materials

Activity


4. Event listeners

Materials

Activity


Prep

Functions

Events and Element.addEventListener()

Free Code Camp Exercises