Skip to content

Commit

Permalink
Update 1620.js
Browse files Browse the repository at this point in the history
  • Loading branch information
oesnuj authored Aug 6, 2024
1 parent 20e59d3 commit 060f3d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions oesnuj/ํ•ด์‹œ/1620.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
console.log(result);

0 comments on commit 060f3d8

Please sign in to comment.