JavaScript Simplified / Chapter 78 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 preferred way to define an object is the __________ method. object literal objectliteral
A property named "plant location" must be defined using (one word) ______ notation. bracket bracket
Rewrite this using the alternative method. const caninePet = {}; const caninePet = new Object(); constcaninePet=newObject\(\);
Rewrite this using the alternative notation. caninePet.name = "Elvis"; caninePet["name"] = "Elvis"; caninePet\[•name•\]=•Elvis•;
Declare an object using the alternative to the object literal method. Make up the object identifier. const planet9 = new Object; const[a-z_$][a-zA-Z0-9_$]*=newObject;
Define an integer property using bracket notation. Make up everything. let planet9["oxygen level"] = 0; let[a-z_$][a-zA-Z0-9_$]*\[•.*•\]=(0|-?[1-9][\d]*);
Declare an empty object using the alternative to the object literal method. Then define an integer property of the object using bracket notation. Make up everything. const planet9 = new Object();
planet9["oxygen level"] = 0;
const([a-z_$][a-zA-Z0-9_$]*)=newObject\(\);[\r\n]\1\[•.*•\]=(0|-?[1-9][\d]*);
Assign a string property to a variable. Then use the variable to define a property. Make up everything. let property44 = "oxygen level";
planet9[property44] = "none";
let([a-z_$][a-zA-Z0-9_$]*)=•.*•;[\r\n][a-z_$][a-zA-Z0-9_$]*\[\1\]=•.*•;
  1. Click the HTML button to see my markup for an empty paragraph.
  2. Click the Result button to see a blank page.
  3. Click the JS button.
  4. Create an object using the alternative to the object literal method.
  5. Assign the object a property using dot notation.
  6. Copy the value of the property to the empty paragraph.
  7. If you've coded correctly, the value will be displayed on the page.
  8. For help with this code, see Chapter 78 in the book.
  1. Click the HTML button to see my markup for an empty paragraph.
  2. Click the Result button to see a blank page.
  3. Click the JS button.
  4. Create an empty object using the object literal method.
  5. Assign a property to the object using bracket notation.
  6. Copy the value of the property to the paragraph using dot notation.
  7. If you've coded correctly, the value will be displayed on the page.
  8. For help with this code, see Chapter 78 in the book.