Same in every language with IEEE floats and a comparison sort. JS is worse because sort() defaults to comparing strings.