https://www.codewars.com/kata/559ac78160f0be07c200005a
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:
Write a function that returns a string in which firstname is swapped with last name.
Example(Input --> Output)
"john McClane" --> "McClane john"
코드
function nameShuffler(str){
return str.split(' ').reverse().join(' ');
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Sum of Minimums! (7 kyu) / JavaScript (0) | 2023.04.02 |
---|---|
[Codewars] The Feast of Many Beasts (8 kyu) / JavaScript (0) | 2023.04.01 |
[Codewars] Directions Reduction (5 kyu) / JavaScript (0) | 2023.03.30 |
[Codewars] Surface Area and Volume of a Box (8 kyu) / JavaScript (0) | 2023.03.29 |
[Codewars] Sort Numbers (7 kyu) / JavaScript (0) | 2023.03.28 |
댓글