All challenges
Multiple ChoiceBeginner 30s

Array sort with Comparator

Choose the best answer for: numeric sort
Options
  1. 1arr.sort() needs an external library to order numbers at all
  2. 2arr.sort((a,b) => a - b) sorts numbers ascending
  3. 3arr.sort() sorts numerically since comparator is a string
  4. 4arr.sort() sorts numbers correctly without a comparator fn

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle