(3/10)
Counting Sheep — JavaScript typing lesson
Master numbers and basic arithmetic operations in JavaScript.
What you'll practice
Let's help a sleepy robot count sheep using a `for` loop! A loop repeats code for us.
- A `for` loop has three parts in its parentheses: setup, condition, and update.
- `let sheep_count = 0` sets up our counter.
📜JavaScript
Counting Sheep
0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
for (let sheep_count = 0; sheep_count < 5; sheep_count++) {↵
console.log('sheep number');↵
console.log(sheep_count);↵
}
0 / 124
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