It may not be the most eye perfect code however the perf are close to the reducer solution jsperf.com/longestwordjs/11
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.
Learned something new regarding jsperf, thank you. 🙏
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.