What is your hint or solution suggestion?
First, the maximum string length needs to be found. This is done by using
Array.reduce and a conditional function to test the length of each string compared to the known maximum length.
Array.filter method is used to only keep strings which are of maximum length.
var ln = arr => arr.reduce((r,s) => r > s.length ? r : s.length, 0); const longestString = arr => arr.filter(pl => pl.length == ln(arr));
Challenge: Longest string challenge
Link to the challenge: