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

JavaScript's built-in bind()method allows an object to borrow another object's ______. method method
In the following statement, what goes into the blank is a _______. let _______ = nationCA.calcDensity.bind(nationMX); variable variable
The object nationMX is borrowing from nationCA. Fill in the blank. let calcMXDensity = nationCA.calcDensity.bind_________ (nationMX); \(nationMX\);
The object nationMX is borrowing from nationCA. Fill in the blank. let calcMXDensity = nationCA.calcDensity__________________ .bind(nationMX); \.bind\(nationMX\);
The object nationMX is borrowing the method add() from nationCA. Fill in the blank. let calcMXDensity = nationCA___________________________ .add.bind(nationMX); \.add\.bind\(nationMX\);
The object x is borrowing the method y() from the object z. Make up the variable. let v = z.y.bind(x); let[a-z_$][a-zA-Z0-9_$]*=z\.y\.bind\(x\);
Code a bind() statement. Make up everything. let x = z.y.bind(p); let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.[a-z_$][a-zA-Z0-9_$]*\.bind\([a-z_$][a-zA-Z0-9_$]*\);
Below is a bind() statement. Call the borrower's method. let calc = nationCA.calcDensity.bind(nationMX); calc(); calc\(\);
  1. I've coded two objects.
  2. Lend the first object's method to the second object.
  3. Call the borrower's method.
  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 the string.
  7. Dismiss the alert by clicking OK.
  8. For help with this code, see Chapter 80 in the book.
  1. I've coded two objects.
  2. Lend the first object's method to the second object.
  3. Call the borrower's method.
  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 the number.
  7. Dismiss the alert by clicking OK.
  8. For help with this code, see Chapter 80 in the book.