Horje
return longest string from array Code Example
return longest string from array
arr.reduce((a, b)=> a.length > b.length ? a : b);
javascript return longest string in array
 function data(str){
           var show = str.split(" ");
            show.sort(function (a,b){
                return b.length - a.length; 
            })
            return show[0];
      }
      console.log(data(str = "javascript is my favourite language "));
javascript find the longest string in array
Math.max(...(x.map(el => el.length)));




Javascript

Related
instance use in_array in javascript Code Example instance use in_array in javascript Code Example
storybook absolute paths Code Example storybook absolute paths Code Example
jquery input change while typing Code Example jquery input change while typing Code Example
cube camera three js Code Example cube camera three js Code Example
read file size javascript Code Example read file size javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9