·6 min read
Your sort does nothing in Node and works in Bun
A comparator that returns true or false never returns a negative number, so V8 leaves the array exactly as it was. The same line sorts correctly in Bun, which is why it survives code review and ships.