educative.io

Educative

Javascript - Why do you need (a, b) => a - b in the Sort function?

Why do you need (a, b) => a - b in the Sort function? When I remove the comparator function I get the same answer but the triplets are arranged in a different order but still the correct values.