Javascript Array.sort implementation?

后端 未结 9 1808
难免孤独
难免孤独 2020-11-22 06:58

Which algorithm does the JavaScript Array#sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds o

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 07:46

    I think that would depend on what browser implementation you are refering to.

    Every browser type has it's own javascript engine implementation, so it depends. You could check the sourcecode repos for Mozilla and Webkit/Khtml for different implementations.

    IE is closed source however, so you may have to ask somebody at microsoft.

提交回复
热议问题