loading...

re: Keeping Your Code Simple VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Sometimes, there's an even simpler solution: const strs = ['hello', 'goodbye', 'farewell', 'aloha']; strs.sort((str1, str2) => str2.length -...
 

I don't think this is a simpler solution, albeit from a logical point of view: it may be understood only considering the outcome of the sorting process, then getting the first item as the one with the minor size...

code of conduct - report abuse