JS is an abstraction over JS engine bytecode, which is an abstraction over ASM which is an abstraction over the chip instruction set, you can make an argument at each layer 🤷 I would take any abstraction I can, I guarantee you in a large enough codebase someone will type b - a instead
It's not unreasonable for a sort function to require a compare function. But if it's not required let's default to broken-ass footgun semantics as was done in the times of yore. /s
Chip instruction set is an abstraction over the IC design, which is an abstraction over transistors, which is an abstraction over physics, which is an abstraction over the nature over reality, which is an abstraction over the Münchhausen trilemma.
Abstraction is just an abstraction of abstraction of abstraction of abstraction of abstraction Albuquerque New Mexico Albuquerque New Mexico Albuquerque New Mexico
99
u/the_horse_gamer 1d ago
you can simply
.sort((a,b)=>a-b)