(1/10)

Functions With Ingredients (Parameters) — JavaScript typing lesson

Learn function parameters to make flexible functions.

What you'll practice

Let's make our functions more powerful by giving them ingredients, called parameters!

  • The parameter `name` is a variable that exists only inside the function.
  • When you call the function, you give it the value for the parameter, like `greet('Alice')`.

Pro Access Required

This is a premium lesson. Upgrade to Pro to unlock this interactive exercise and continue your learning journey.

📜JavaScript

Functions With Ingredients (Parameters)

0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
6
7
function greet(name) {↵
console.log('Hello, ' + name + '!');↵
}↵
↵
greet('Alice');↵
greet('Bob');↵
greet('Typy');
0 / 111
Press This!
👇
`~
1!
2@
3#
4$
5%
6^
7&
8*
9(
0)
-_
=+
⌫
⇥
Q
W
E
R
T
Y
U
I
O
P
[{
]}
\|
⇪
A
S
D
F
G
H
J
K
L
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky