example:
entry: "StackOverflow" "No response" "Tags"
Output:
"StackOverflow" // string with the largest number of characters.
example:
entry: "StackOverflow" "No response" "Tags"
Output:
"StackOverflow" // string with the largest number of characters.
You do not need to write a function that already exists, use Array. prototype.reduce ()
var strings = ["StackOverflow", "Sem resposta", "Tags"];
var retorno = strings.reduce(function (atual, proximo) {
return atual.length > proximo.length ? atual : proximo;
});
alert(retorno);