DEV Community

Discussion on: Find longest word in a given string

Collapse
 
fabiengreard profile image
Fabien Gréard

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...

Collapse
 
abhidon profile image
Abhinay Donadula

Learned something new regarding jsperf, thank you. 🙏