Week 11: Lists and arrays
JavaScript code typing course. 20 wpm, 93% accuracy.
An array holds several values in one place. In JavaScript you write it with square brackets and separate the values with commas, so [1, 2, 3] is an array of three numbers. You read one item by putting its position, or index, in square brackets after the array name, as in list[0], which gives the first item. Counting starts at 0, which can feel strange at first. This week you practice all of these symbols together.
What you will learn
This week uses three symbols on the US English layout:
[is the left square bracket key, pressed with your right pinky.]is the right square bracket key, pressed with your right pinky.,is the comma key, pressed with your right middle finger.
Practice with [1, 2, 3] for building an array and list[0] for reading its first item. No new keywords appear this week.
Technique tips
- Type the pair
[]first, then fill in the items between the brackets. - Put a space after each comma, as in
1, 2, 3. - Keep your right pinky close to the bracket keys and move only that finger.
- Count indexes from 0 in your head before you type
list[0], so the number matches the item you want. - After each closing bracket, check the line once before you continue.
Lessons
- Learn (10–15 minutes): Watch the keyboard demo for
[,]and,, then type each symbol a few times. - Practice (10–15 minutes): Type
[1, 2, 3]andlist[0]again and again, checking that each bracket closes. - Review (10–15 minutes): Take the two-minute test and focus on the commas between items.
This week’s goal
Your targets are 20 WPM and 93% accuracy. Finishing the week earns one star. Reaching 93% accuracy earns two stars, and reaching the speed target as well earns three. A missed comma or a missing bracket shifts every item after it, so focus on accuracy first.
Symbols this week
The colored keys are the ones you learn this week. The color shows which finger presses the key.
This week’s lessons
Do the lessons in order. Each one ends with a test, and your best result is saved.