반응형
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
Solution:
let howManyLightsabersDoYouOwn = (name) => (name == 'Zach') ? 18 : 0
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
0110. altERnaTIng cAsE <=> ALTerNAtiNG CaSe (0) | 2023.01.11 |
---|---|
0109. A Needle in the Haystack (0) | 2023.01.09 |
0107. Exclamation marks series #4: Remove all exclamation marks from sentence but ensure a exclamation mark at the end of string (0) | 2023.01.07 |
0106. Is there a vowel in there? (0) | 2023.01.07 |
0105. Greet Me (0) | 2023.01.05 |