Skip to content

Commit 91c7e03

Browse files
committed
friend list of length
1 parent fb5a1cc commit 91c7e03

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

array-exists.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
function bestFriend(friendNames){
2+
3+
let max = friendNames[0];
4+
5+
for(element of friendNames){
6+
7+
// console.log(element);
8+
if(element.length > max.length){
9+
10+
max=element;
11+
}
12+
}
13+
return max;
14+
}
15+
16+
console.log(bestFriend(['nim','Farhana','binte','THasan','Tazakistan']));
17+
18+
19+
let namesIs ="Tazakistan";
20+
console.log(namesIs.length);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy