๋ชฉ๋ก0 ๋–ผ๊ธฐ (1)

๐Ÿค ์€์ง€log ๐Ÿค

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] 0 ๋–ผ๊ธฐ

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0 - 0 ๋–ผ๊ธฐ ๐Ÿ’š ๋ฌธ์ œ์„ค๋ช… ์ •์ˆ˜๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฌธ์ž์—ด n_str์ด ์ฃผ์–ด์งˆ ๋•Œ, n_str์˜ ๊ฐ€์žฅ ์™ผ์ชฝ์— ์ฒ˜์Œ์œผ๋กœ ๋“ฑ์žฅํ•˜๋Š” 0๋“ค์„ ๋—€ ๋ฌธ์ž์—ด์„ returnํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”. ๐Ÿ’š ์ œํ•œ์กฐ๊ฑด 2 ≤ n_str ≤ 10 n_str์ด "0"์œผ๋กœ๋งŒ ์ด๋ฃจ์–ด์ง„ ๊ฒฝ์šฐ๋Š” ์—†์Šต๋‹ˆ๋‹ค. ๐Ÿ’š ํ’€์ด function solution(n_str) { const answer = Number(n_str) return answer.toString() } โœ… Number( ) ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฌธ์ž์—ด์„ ์ˆซ์žํƒ€์ž…์œผ๋กœ ๋ฐ”๊ฟ€์ˆ˜ ์žˆ๊ณ (๊ทธ๋Ÿผ ์•ž์—๋ถ™์€ 0์„ ์ œ๊ฑฐํ• ์ˆ˜ ์žˆ๋‹ค !), ๋‹ค์‹œ toString( ) ๋ฉ”์„œ๋“œ๋กœ ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜ํ•ด์ฃผ์—ˆ๋‹ค. ๐Ÿ’ก ๋‹ค๋ฅธ์‚ฌ๋žŒํ’€์ด (...๋ฏธ์ถ‹๋‹น๐Ÿซข) const solution = (str) =>..