Skip to content

Commit 5b95f09

Browse files
problem 45 solved
1 parent 8d4b226 commit 5b95f09

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

problem45/problem45.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,22 @@ Print the result.
1616
*/
1717

1818

19+
const findEven = nameList => {
20+
21+
const evenLengthName = [];
22+
for(let i = 0; i < nameList.length; i++){
23+
24+
const friendName = nameList[i];
25+
if(friendName.length % 2 == 0){
26+
evenLengthName.push(friendName);
27+
}
28+
}
29+
30+
return evenLengthName;
31+
}
32+
33+
34+
const friendsName = ["Shourav", "Nirob", "Alal", "Jala", "Ashim", "Shipta", "Pritom", "Arko", "Alu"];
35+
36+
const evenLengthFriendsNameList = findEven(friendsName);
37+
console.log(evenLengthFriendsNameList);

0 commit comments

Comments
 (0)