(7/10)
Getting Items From An Array — JavaScript typing lesson
Access array elements using index positions.
What you'll practice
Let's pick a specific toy from our toy box! We use index numbers, and the count always starts from 0.
- The first item in an array is at index 0.
- The index number goes inside square brackets [].
📜JavaScript
Getting Items From An Array
0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
let toy_box = ['robot', 'car', 'dinosaur'];↵
console.log('the first toy is');↵
console.log(toy_box[0]);↵
console.log('the third toy is');↵
console.log(toy_box[2]);
0 / 159
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
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky