I would probably go for a combo prototype/function.
// Can be used as-isfunctionlongestString(first,second){returnsecond.length>first.length?second:first}// But the prototype makes it more natural to read laterArray.prototype.longest=function(){returnthis.reduce(longestString,'')};// You know the winner is and will forever be..constlanguages=['javascript','php','ruby','python']languages.longest()// "javascript" 😎
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would probably go for a combo prototype/function.