← Quiz: Tags, Releases and Versioning: all 15 questions
Quiz: Tags, Releases and Versioning · Question 7 of 15
What does this print? (code)
What does this print?
console.log(["v2.10.0", "v2.9.0"].sort()[0]);
- A.v2.9.0
- B.v2.10.0
- C.undefined
- D.v2
Answer & explanation
Correct answer: v2.10.0
Text sorting compares character by character: "1" comes before "9", so v2.10.0 sorts first, which is wrong for versions.
Can you get the rest right without peeking?
Take the timed Quiz: Tags, Releases and Versioning quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →