JavaScript Simplified / Chapter 11 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

What is the tag for commenting 1 JavaScript line at a time? // \/\/
What is the opening tag for a JavaScript block comment? /* \/\*
Code a single-line comment that says No comment // No comment \/\/Nocomment
Code a block comment. On the first line write: Hello. On the second line write: World! /*
Hello
World!
*/
\/\*[\r\n]Hello[\r\n]World![\r\n]\*\/
Write a 1-line comment. Make up the comment. // A comment on 1 line \/\/.*
Code an alert followed by a comment—all on a single line. Make up the alert text and the comment. alert("Hello world!"); // Greet the user alert\(•.*•\);\/\/.*
Write two lines of text as a block comment. Make up the comment. /*
This comment refers to
the code that follows
*/
\/\*[\r\n].*[\r\n].*[\r\n]\*\/
Rewrite this line of code so it doesn't execute. let a = 1; // let a = 1; \/\/leta=1;
  1. Code an alert. Add a comment on the same line.
  2. Click the Result button (or, after revising, don't click, just wait).
  3. Wait a moment.
  4. If you've coded correctly, your alert will display.
  5. Dismiss the alert by clicking OK.
  6. For help with this code, see Chapter 11 in the book.
  1. Write two lines of text as a block comment. Below the comment, code an alert.
  2. Click the Result button (or, after revising, don't click, just wait).
  3. Wait a moment.
  4. If you've coded correctly, your alert will display.
  5. Dismiss the alert by clicking OK.
  6. For help with this code, see Chapter 11 in the book.