diff --git "a/oesnuj/\355\225\264\354\213\234/1620.js" "b/oesnuj/\355\225\264\354\213\234/1620.js" index d78b8f5..3511f15 100644 --- "a/oesnuj/\355\225\264\354\213\234/1620.js" +++ "b/oesnuj/\355\225\264\354\213\234/1620.js" @@ -15,13 +15,12 @@ pokemonList.forEach((pokemon, index) => { let result = ''; testList.forEach(test => { - const num = Number(test); - if (!isNaN(num)) { + if (!isNaN(test)) { // 테스트 값이 번호인 경우 - result += pokemonList[num - 1] + '\n'; // 번호에 해당하는 Pokémon 이름 추가 + result += pokemonList[test - 1] + '\n'; // 번호에 해당하는 Pokémon 이름 추가 } else { // 테스트 값이 이름인 경우 result += pokemonMap.get(test) + '\n'; // 이름에 해당하는 Pokémon 번호 추가 } }); -console.log(result); \ No newline at end of file +console.log(result);