JavaScript Simplified / Chapter 88 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 array name is minerals. Complete the destructuring statement. const [a, b, c] _______; = minerals =minerals
The variables are first and second. Complete the destructuring statement. let ___________ = players;] [first, second] \[first,second\]
Use destructuring to assign the elements of numArray to the variables a, b, and c. let [a, b, c] = numArray; let\[a,b,c\]=numArray;
Assign the three elements of an array to variables using destructuring. Make up everything. let [a, b, c] = cities; let\[[a-z_$][a-zA-Z0-9_$]*,[a-z_$][a-zA-Z0-9_$]*,[a-z_$][a-zA-Z0-9_$]*\]=[a-z_$][a-zA-Z0-9_$]*;
Assign the first and third elements of an array to variables. Make up everything. let [a, , c] = cities; let\[[a-z_$][a-zA-Z0-9_$]*,,[a-z_$][a-zA-Z0-9_$]*\]=[a-z_$][a-zA-Z0-9_$]*;
The object, corp, has only one property, size. Fill in the blank to assign the property to a variable. let {
  _______
} = corp;
size size
Convert this statement to a destructuring statement. const pop = province.population; let {
  population
} = province;
let{[\r\n]population[\r\n]}=province;
Code a complete restructuring statement for an object with two properties. Make up everything. let {
  population,
  area
} = nationIN;
let{[\r\n][a-z_$][a-zA-Z0-9_$]*,[\r\n][a-z_$][a-zA-Z0-9_$]*[\r\n]}=[a-z_$][a-zA-Z0-9_$]*;
  1. I've coded an array. Assign its elements to variables using destructuring.
  2. Display one of the variable values in an alert.
  3. Wait a moment.
  4. If you've coded correctly, an alert will display one of the values.
  5. Dismiss the alert by clicking OK.
  6. For help with this code, see Chapter 88 in the book.
  1. I've coded an object. Assign its properties to variables using destructuring.
  2. Display one of the variable values in an alert.
  3. Wait a moment.
  4. If you've coded correctly, an alert will display one of the values.
  5. Dismiss the alert by clicking OK.
  6. For help with this code, see Chapter 88 in the book.