DEV Community

Discussion on: 8 Best JavaScript One-Liners

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Try the shorter sortBy with repeated identifiers. Works just fine. If the two identifiers are equal it makes no difference what order they are sorted in.

My splice example doesn't mutate the original array.

Thread Thread
 
jonrandy profile image
Jon Randy 🎖️

Might want to fix the glaring typo in the header image too! 😉

Thread Thread
 
shivams1007 profile image
Shivam Singh

@jonrandy which one?

Thread Thread
 
jonrandy profile image
Jon Randy 🎖️

"8 One-Linear You Will Love"

Thread Thread
 
shivams1007 profile image
Shivam Singh • Edited

ohh yes you are correct! 😊
I am open for any other suggestions