Search code snippets, questions, articles...

Get a bigger word from a javascript array

console.log(longestStringReduce(['boop', 'bloomburg', 'hello']));

function longestStringReduce(arr) {
  return arr.reduce((a, b) => a.length < b.length ? b : a, "");
}

//bigger word
//bloomburg

Get a bigger word from a javascript array

Search Index Data (The code snippet can also be found with below search text)

Get a bigger word from a javascript array
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet