https://www.codewars.com/kata/51f9d93b4095e0a7200001b8
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:
Inspired by the development team at Vooza, write the function that
- accepts the name of a programmer, and
- returns the number of lightsabers owned by that person.
The only person who owns lightsabers is Zach, by the way. He owns 18, which is an awesome number of lightsabers. Anyone else owns 0.
Note: your function should have a default parameter.
For example(Input --> Output):
"anyone else" --> 0
"Zach" --> 18
코드
function howManyLightsabersDoYouOwn(name) {
return name === "Zach" ? 18 : 0;
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Welcome! (8 kyu) / JavaScript (0) | 2023.05.08 |
---|---|
[Codewars] altERnaTIng cAsE <=> ALTerNAtiNG CaSe (8 kyu) / JavaScript (0) | 2023.05.07 |
[Codewars] JavaScript Array Filter (7 kyu) / JavaScript (0) | 2023.05.06 |
[Codewars] Remove duplicates from list( kyu) / JavaScript (0) | 2023.05.06 |
[Codewars] Grasshopper - Messi goals function (8 kyu) / JavaScript (0) | 2023.05.05 |
댓글