Return the Four Letter Strings

Published by Alex Golubov in

Create a function that takes a vector (array) of strings. Return all words in the vector (array) that are exactly four letters.

Examples

isFourLetters(["Tomato", "Potato", "Pair"]) ➞ ["Pair"]

isFourLetters(["Kangaroo", "Bear", "Fox"]) ➞ ["Bear"]

isFourLetters(["Ryan", "Kieran", "Jason", "Matt"]) ➞ ["Ryan", "Matt"]

Notes

You can expect valid strings for all test cases.

Watch a quick demo on how Edabit works.