javascript
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
Was this helpful?
Similar Posts
- Get all values from an array which does not exist in other array Lodash
- Sort array using Array.sort() in javascript
- Break an array into fixed length array groups using lodash in Javascript
- Convert a string to array using Array.from() in javascript
- Javascript Code for Sorting array and finding Largest No. in Array
- Get Top MAX and MIN itens inside array Javascript
- Get the sum of array values using Javascript - Solved