Horje
find a big length friend from array javascript finding longest string in array in javascript Code Example
find a big length friend from array javascript finding longest string in array in javascript
//find a big length friend from array in javascript or finding longest string in array in javascript
function bigFrnd(names){
    bigFrnd = names[0];
    for(var i=0;i<names.length;i++){
        if(bigFrnd.length<names[i].length){
            bigFrnd = names[i];
        }
    }
    return bigFrnd;
}
var frnds = ['John','Justin','Messi',"Doe",'Mike','Chester','Kim'];
console.log(bigFrnd(frnds))




Javascript

Related
installing ruby version using Rbenv Code Example installing ruby version using Rbenv Code Example
Node-Red Custom UI Code Example Node-Red Custom UI Code Example
only integer allowed javascript Code Example only integer allowed javascript Code Example
How to upper case a string in javascrip Code Example How to upper case a string in javascrip Code Example
mongoose geospatial Schema Options Code Example mongoose geospatial Schema Options Code Example

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