I don\'t understand the logic of sorting an array by returning 1 or 0 or -1 if it returns these values how the sort function can decide which one to put first
Example