longest
longest copied to clipboard
Multiple 'longest' element
Given the following array:
['hello', 'hellohello1','hello', 'hellohello2']
longest would return 'hellohello1'
, even though there are two 11-chars elements.
I would suggest adding a optional argument* that would allowed returning an array with all max-length elements.
* I think defaulting this argument to return an array is better, but defaulting to single return is reasonable as well.