JavaScript Simplified / Chapter 61 Exercises

  • Index of exercises
  • Email me

1

2

3

4

5

6

7

8

9

10

Congratulations. You've aced all the exercises for this chapter.


To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.


Are you ready to rate JavaScript Simplified? on Amazon?


Rate it on Amazon.

0,1,2,3,4,5,6,7,8,9

0

0

0

0

The variable being tested is shape. Fill in the blank. switch ________ { (shape) \(shape\)
Fill in the blank. switch (shape) _ { {
Code the first line of a switch statement that tests the variable species. switch (species) { switch\(species\){
Code the first line of a switch statement that tests the variable score. switch (score) { switch\(score\){
Code the first line of a switch statement that tests a variable. Make up the name of the variable. switch (x) { switch\([a-z_$][a-zA-Z0-9_$]*\){
Fill in the blank. Make up an integer value. case _______ 50: (0|-?[1-9][\d]*):
Code the second line, testing whether the value is "blue". Don't bother to indent. case "blue": case•blue•:
Fill in the blank to end the testing. switch (registered) {
  case true:
    alert("Congratulations");
    _______
}
break; break;
  1. I've coded a variable assignment and a switch statement that's missing two lines. Leave my code intact.
  2. Insert two lines of code to complete the switch statement.
  3. If the value of num is 99, an alert displays "ok".
  4. Click the Result button (or, after revising, don't click, just wait).
  5. Wait a moment.
  6. If you've coded correctly, an alert will display "ok".
  7. Dismiss the alert by clicking OK.
  8. For help with this code, see Chapter 61 in the book.
  1. I've coded a variable assignment and a switch statement that's missing three lines. Leave my code intact.
  2. Insert three lines of code to complete the switch statement.
  3. If the value of name is "Juanita", an alert displays "ok".
  4. Click the Result button (or, after revising, don't click, just wait).
  5. Wait a moment.
  6. If you've coded correctly, an alert will display "ok".
  7. Dismiss the alert by clicking OK.
  8. For help with this code, see Chapter 61 in the book.