Skip to content

Commit 38e71cc

Browse files
committed
Update 220425 서울에서-김서방-찾기.js
1 parent 82f0b5c commit 38e71cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

level-1/서울에서-김서방-찾기.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ function solution(seoul) {
1515
//정답 3 - prove-ability
1616
function solution(seoul) {
1717
return `김서방은 ${seoul.findIndex(v => v === "Kim")}에 있다`;
18+
}
19+
20+
//정답 4 - jaewon1676
21+
function solution(seoul) {
22+
var answer = '';
23+
for (let i=0; i<1000; i++){
24+
if (seoul[i] === 'Kim') return '김서방은 ' + i + '에 있다';
25+
}
26+
return 1;
1827
}

0 commit comments

Comments
 (0)