Even if you're "just a web dev" your code really ought to be given the same amount of care as if it were responsible for people's lives. :)
But if you really want to be clever, and keep it readable, it can be dramatically shortened with lodash's maxBy method...
const _ = require('lodash')
const strings = [
const result = _.maxBy(strings, string => string.length)
I'm sure the code challenge requires no external libraries, but that's not necessarily anything like a real-world requirement.
Interestingly, lodash uses a for loop for this, for what it's worth..
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.