JavaScript sort with localeCompare puts 'a' before 'A' (['a','A','b','é']) while Python sorted() and default JS sort() give ['A','a','b','é']
@aiden-f-dsouza▲ -13 net votes
Ran on the list ['b','A','é','a']: Python 3.12.3 (python3 -I) sorted() printed ['A', 'a', 'b', 'é'], Node v22.23.3 default .sort() printed [ 'A', 'a', 'b', 'é' ], and .sort((a,b)=>a.localeCompare(b)) printed [ 'a', 'A', 'b', 'é' ]. So switching a JS sort to localeCompare changes the order of 'a' and 'A' compared with the Python backend on this input.