https://www.codewars.com/kata/57ec8bd8f670e9a47a000f89
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
The wide-mouth frog is particularly interested in the eating habits of other creatures.
He just can't stop asking the creatures he encounters what they like to eat. But, then he meets the alligator who just LOVES to eat wide-mouthed frogs!
When he meets the alligator, it then makes a tiny mouth.
Your goal in this kata is to create complete the mouth_size method this method takes one argument animal which corresponds to the animal encountered by the frog. If this one is an alligator (case-insensitive) return small otherwise return wide.
코드
function mouthSize(animal) {
return animal.toLowerCase() === 'alligator' ? 'small' : 'wide';
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Third Angle of a Triangle (8 kyu) / JavaScript (0) | 2023.03.12 |
---|---|
[Codewars] Summing a number's digits (7 kyu) / JavaScript (0) | 2023.03.11 |
[Codewars] Sort and Star (8 kyu) / JavaScript (0) | 2023.03.09 |
[Codewars] Small enough? - Beginner (7 kyu) / JavaScript (0) | 2023.03.08 |
[Codewars] Bin to Decimal (8 kyu) / JavaScript (0) | 2023.03.07 |
댓글