`Array.sort` expects an integer as its response (1 for greater than, 0 for equal, -1 for less than). It does work with booleans but is not as efficient.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort