DEV Community

Discussion on: 4 Ideas of how to harness the power of Typescript generic function

Collapse
 
titoasty profile image
nico-boo

In sortBy, wouldn't it be better to write

[...array].sort

instead of

[...array.sort

to prevent mutation?

Great article!

Collapse
 
glebirovich profile image
Gleb Irovich

That’s a great catch! thank you πŸ™ I will fix it