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

Two characters in this code are incorrect. Type the two correct characters. let allLower = userInput.tolowercase(); LC - it must be in camelCase: toLowerCase() LC
What is the value of upperVersion? Include the quotation marks in your answer. let upperVersion = "no!".toUpperCase(); "NO!" •?NO•?!
Convert the string in the variable upperString to lowercase and assign the result to lowerString, which hasn't been declared beforehand. let lowerString = upperString.toLowerCase(); letlowerString=upperString\.toLowerCase\(\);
Convert the string in the variable x to lowercase and assign the result to the same variable. x = x.toLowerCase(); x=x\.toLowerCase\(\);
Convert the string in a variable to uppercase and assign the result to a second variable that hasn't been declared beforehand. Make up the variable names. let nameUpper = name.toUpperCase(); let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.toUpperCase\(\);
Convert a string to lowercase and assign the result to a variable that has been declared beforehand. Make up the variable name and the string. convertedString = "Dog".toLowerCase(); [a-z_$][a-zA-Z0-9_$]*=•.*•\.toLowerCase\(\);
Display in an alert the uppercase version of a string that has been assigned a variable. Make up the variable name. alert(message.toUpperCase()); alert\([a-z_$][a-zA-Z0-9_$]*\.toUpperCase\(\)\);
Convert the string in an array element to lowercase and assign it to a variable that hasn't been declared beforehand. Make up everything. let lowerVersion = pets[1].toLowerCase(); let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\[(0|-?[1-9][\d]*)\]\.toLowerCase\(\);
  1. Assign your full name to a variable.
  2. Code an alert that displays the lowercase version.
  3. Click the Result button (or, after revising, don't click, just wait).
  4. Wait a moment.
  5. If you've coded correctly, your name will display in lowercase.
  6. Dismiss the alert by clicking OK.
  7. For help with this code, see Chapter 32 in the book.
  1. Prompt for a last name.
  2. Enter your last name in the prompt field.
  3. Code an alert that displays the uppercase version.
  4. Click the Result button (or, after revising, don't click, just wait).
  5. Wait a moment.
  6. If you've coded correctly, your last name will display in uppercase.
  7. Dismiss the alert by clicking OK.
  8. For help with this code, see Chapter 32 in the book.