Week 6: Brackets and braces

JavaScript code typing course. 15 wpm, 91% accuracy.

In JavaScript, square brackets hold lists and curly braces open blocks of code. [1] is a list with one item, and { } is an empty block. Every opening bracket or brace must have a matching closing one, and a single missing one can stop the whole program from running. This week you learn where all four symbols sit on the US English layout and practice pairing them correctly.

What you will learn

This week introduces four 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 Shift plus the left square bracket key. Press Shift with the opposite pinky and the bracket key with your right pinky.
  • } is Shift plus the right square bracket key. Press Shift with the opposite pinky and the bracket key with your right pinky.

Practice with short structures such as [1] and { }. This week has no new keywords, so your attention goes to the pairs.

Technique tips

  • Type the pair first, then fill in the middle. This keeps the brackets matched from the start.
  • For { and }, press Shift with the opposite pinky before you press the bracket key, and release both together.
  • Both bracket keys use your right pinky, so keep your hand close to the home row and move only that finger.
  • Look at the screen to check that each opening bracket has its partner.
  • If you lose track of a pair, stop, count the openings and closings, then continue.

Lessons

  1. Learn (10–15 minutes): Watch the keyboard demo for all four symbols, then type each one a few times.
  2. Practice (10–15 minutes): Type [1] and { } again and again, checking that every opening has a closing partner.
  3. Review (10–15 minutes): Take the two-minute test and focus on pairing the brackets correctly.

This week’s goal

Your targets are 15 WPM and 91% accuracy. Finishing the week earns one star. Reaching 91% accuracy earns two stars, and reaching the speed target as well earns three. An unmatched bracket breaks the whole line, so get the pairs right before you chase speed.

Symbols this week

The colored keys are the ones you learn this week. The color shows which finger presses the key.

` ~ 1 ! 2 @ 3 # 4 $ 5 % 6 ^ 7 & 8 * 9 ( 0 ) - _ = + Backspace Tab Q W E R T Y U I O P [ { ] } \ | Caps A S D F G H J K L ; : ' " Enter Shift Z X C V B N M , < . > / ? Shift Ctrl Win Alt Alt Gr Win Menu Ctrl

This week’s lessons

Do the lessons in order. Each one ends with a test, and your best result is saved.

  1. Lesson 1: Learn

    New symbols: [ ] { }

    12 minutes

    Start
  2. Lesson 2: Practice

    Practice

    12 minutes

    Start
  3. Lesson 3: Review and test

    Review and test

    12 minutes

    Start

All weeks