re: Find longest word in a given string VIEW POST

VIEW FULL DISCUSSION
 

It may not be the most eye perfect code however the perf are close to the reducer solution jsperf.com/longestwordjs/11

carbon

I would still go to with the reducer solution, but sometimes doing 'old' things works very nice

I also try with for loop / for of, I expected it to be way more faster than everything else but it didn't.

from jsperf.com/foreach-vs-reduce-vs-fo...

 

Learned something new regarding jsperf, thank you. 🙏

code of conduct - report abuse