Using typeof ์ฑ๋ฆฐ์ง์์ ์ ์ถํด์ผํ๋ ๊ฒฝ์ฐ :
console.log(typeof "")
console.log(typeof 0)
console.log(typeof [])
console.log(typeof {})
๊ทธ๋ฌ๋ ์ธ๋ฏธ์ฝ๋ก ์ด ์ถ๊ฐ ๋ ๊ฒฝ์ฐ :
console.log(typeof "");
console.log(typeof 0);
console.log(typeof []);
console.log(typeof {});
๊ทธ๋ฐ ๋ค์ ๋ชจ๋ ํ ์คํธ๊ฐ ํต๊ณผ๋ฉ๋๋ค. ์๋ฐ ์คํฌ๋ฆฝํธ๋ ์ธ๋ฏธ์ฝ๋ก ์ ํ์๋กํ์ง ์์ผ๋ฏ๋ก ์ธ๋ฏธ์ฝ๋ก ์ ์ฌ์ฉํ์ง ์๋ ์ฌ์ฉ์์ ๋ฌธ์ ๋ฅผ ๋ณต์กํ๊ฒ ๋ง๋ญ๋๋ค.
@ ChrisBrownie55์ด ๋ฒ๊ทธ๋ฅผ ์ ๊ณ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!
์ฑ๋ฆฐ์ง๋ ๋ฒ ํ์์ ์ ๊ฑฐ๋์์ง๋ง typeof์ ๋ํด์๋ ์ฌ์ ํ ์ฑ๋ฆฐ์ง๊ฐ ์์ต๋๋ค. ๋ํ ์ธ๋ฏธ์ฝ๋ก ์ด ํ์ํฉ๋๋ค. ์ฐ๋ฆฌ๋ ์ฌ๊ธฐ์ ๊ทธ๊ฒ์ ๊ฐ์ ํ ํ์๊ฐ ์์ต๋๋ค.
์ฌ๊ธฐ์์ ์ฝ๋๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
https://github.com/freeCodeCamp/freeCodeCamp/blob/5214371ef124f24f242cd8a619ba8a8f1992cbe6/seed/challenges/02-javascript-algorithms-and-data-structures/debugging.json#L129
์ ๊ท์์์ ์ธ๋ฏธ์ฝ๋ก ์ ์ ๊ฑฐํ๋ฉด ํธ๋ฆญ์ด ๋ฐ์ํฉ๋๋ค.
CONTRIBUTING.md ๋ฅผ ํ์ธํ์ฌ ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์ ์ค์ ํ์ญ์์ค.
๋์์ด ํ์ํ๋ฉด ๊ธฐ์ฌ์ ์ฑํ ๋ฐฉ์ผ๋ก ์ด๋ํ์ธ์. ๋ชจ๋ ์ง๋ฌธ์ ํญ์ ๊ธฐ๊บผ์ด ๋ต๋ณ ํด๋๋ฆฝ๋๋ค!
์ด์ ๋ํ PR์ ์ ์ถํ์ต๋๋ค. ์ด์ ์๋ ํ๋๋ก ์๋ํฉ๋๋ค.
๊ฐ์ฌํฉ๋๋ค @ncaron!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด์ ๋ํ PR์ ์ ์ถํ์ต๋๋ค. ์ด์ ์๋ ํ๋๋ก ์๋ํฉ๋๋ค.