Last active
August 6, 2022 16:31
-
-
Save D3press3dd/429b6155bd7a0fbb00c61ad80afa0703 to your computer and use it in GitHub Desktop.
Make a program that filters a list of strings and returns a list with only your friends name in it. If a name has exactly 4 letters in it, you can be sure that it has to be a friend of yours! Otherwise, you can be sure he's not... Ex: Input = ["Ryan", "Kieran", "Jason", "Yous"], Output = ["Ryan", "Yous"] i.e. frien
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 kyu kata answer to 'Friend or Foe? | |
function friend(friends){ | |
return friends.filter(singleFriend=>singleFriend.length===4); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment