(9/10)
Your First Function — JavaScript typing lesson
Create functions to reuse code blocks.
What you'll practice
Let's teach our program a new trick! A function is a block of code we can name and use over and over.
- `function say_hello() {` starts the definition of our new function.
- The code inside the function goes between the curly braces {}.
📜JavaScript
Your First Function
0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
6
7
function say_hello() {↵
console.log('hello there');↵
console.log('welcome to the world of functions');↵
}↵
↵
say_hello();↵
say_hello();
0 / 137
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
G
H
J
K
L
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky