1

simple sorting in ascending order;

in node v10.15.3

node

in chrome Chromium 79.0.3945.88:

Chromium 79.0.3945.88

Fatah
  • 2,184
  • 4
  • 18
  • 39
  • you have no stable return value. – Nina Scholz Dec 23 '19 at 16:10
  • You should not let the `sort` callback return a boolean (which never can be -1). You should return a number, that is negative when `a < b`. – trincot Dec 23 '19 at 16:18
  • 3
    Does this answer your question? [what's the 'sort' method's difference between chrome environment and node environment](https://stackoverflow.com/questions/56320307/whats-the-sort-methods-difference-between-chrome-environment-and-node-enviro) – Klaycon Dec 23 '19 at 16:20
  • 1
    That dupe target has an answer by a v8 developer, take a look. – Klaycon Dec 23 '19 at 16:21
  • @Klaycon yes. thanks a ton for that – Fatah Dec 23 '19 at 16:22
  • Your "simple sorting" is [using a broken comparison function](https://stackoverflow.com/q/24080785/1048572) – Bergi Dec 23 '19 at 16:38

0 Answers0