
문자열을 입력받아 버그('#')의 인덱스를 리턴해야 합니다.
인자 1 : word
let output = findTheBug('wo#rd');
console.log(output); // --> 2
output = findTheBug('#hello');
console.log(output); // --> 0
output = findTheBug('bug');
console.log(output); // --> undefined
function findTheBug(word)
for(let i = 0; i < word; i++){
if (word[i] === '#'){
return i;
}
}
for 문에서 첫번째는 i++ 진행이 안되고 다음 반복부터 i++ 이 진행된다.