Functions
A function is a named job you can do again and again. Write functions that take parameters and return values, meet function expressions and arrow functions, then look ahead to the data you'll work with in Module 2.
Updated
Functions in JavaScript
- What Is a Function (Novice): A function is a named set of steps you write once and run whenever you need it, by calling its name.
- Parameters and Return Values (Novice): Parameters let a function take in different values each time you call it, and return hands a result back to the code that called it.
- Function Expressions and Arrow Functions (Apprentice): A function can be stored in a variable like any other value, arrow functions (=>) write small functions in a line, and default values fill in the arguments a caller leaves out.
Exercise: Game Score Functions
- Exercise: Game Score Functions (Apprentice): Write the four functions that keep score in a small video game, from points for coins to the end-of-level line, and let the tests check each one.
Up Next: Working with Data
- Up Next: Working with Data (Novice): See how much you can do after Module 1, meet the Rock, Paper, Scissors game where you'll show it, and get a first look at the lists and records Module 2 teaches.