Skip to content

Commit 8f3ca83

Browse files
authored
Merge pull request #127 from front-studium/sgoldenbird
`week28` 풀었습니다.
2 parents fde1b47 + c278012 commit 8f3ca83

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function solution(my_string) {
2+
return [...my_string]
3+
.map((ch) =>
4+
ch === ch.toUpperCase() ? ch.toLowerCase() : ch.toUpperCase()
5+
)
6+
.join("");
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function solution(my_string, num1, num2) {
2+
const arr = [...my_string];
3+
[arr[num1], arr[num2]] = [arr[num2], arr[num1]];
4+
return arr.join("");
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function solution(num) {
2+
return num % 2 === 0 ? "Even" : "Odd";
3+
}

0 commit comments

Comments
 (0)