Question 9
Back to Exercise
In which order does Object.keys({ z: 1, 5: 2, a: 3, 1: 4 }) return the keys?
- A "z", "5", "a", "1"
- B "1", "5", "z", "a" Correct
- C "a", "z", "1", "5"
- D The order is random
Correct Answer: Option B
Integer-like keys come first in ascending numeric order, then the remaining string keys in insertion order.
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!