+25 XP
Lesson 43

Parameters

Passing values to functions!

Parameters = Inputs!

Parameters let you pass information into a function!

Think of it like:

Blender (Function)

You put in fruits (parameters) and get a smoothie!

Calculator (Function)

You give it numbers (parameters) and it adds them!

function greet(name) {
  console.log("Hello, " + name);
}

greet("Alex");   // Hello, Alex
greet("Sam");    // Hello, Sam