#javascript что с тобой не так?..

UPD.

var scores = [1, 2, 10, 21];

scores.sort(); // [1, 10, 2, 21]

как Вам такое поведение? 😁

#ithumor