Question 4
Back to Exercise
Which pattern reads obj.size into a variable s, defaulting to 10?
- A const { size: s = 10 } = obj; Correct
- B const { s: size = 10 } = obj;
- C const { size = 10: s } = obj;
- D const { s = size: 10 } = obj;
Correct Answer: Option A
The order is property : variable = default.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!