hoisting (1) ์ธ๋ค์ผํ ๋ฆฌ์คํธํ [JavaScript] ํธ์ด์คํ (Hoisting) ์ด๋? ๐ ํธ์ด์คํ (Hoisting)์ด๋? ๋ณ์ ๋๋ ํจ์ ์ ์ธ ๋ถ๋ถ์ด ์ต์๋จ์ผ๋ก ๋์ด ์ฌ๋ ค์ง๋ ํ์์ ์๋ฏธํ๋ค. ๋ณ์๊ฐ ์์ผ๋ฉด ์์น์ ์๊ด์์ด ์ต์๋จ์์ undefined๋ ํํ๋ก ์กด์ฌํ๋ค. โญ ์ฃผ์ var ๋ณ์ ์ ์ธ๊ณผ ํจ์ ์ ์ธ๋ฌธ์์๋ง ํธ์ด์คํ ์ด ์ผ์ด๋๋ค. (let/const ๋ณ์ ์ ์ธ, ํจ์ ํํ์์์๋ ๋ฐ์ํ์ง ์๋๋ค.) 12345console.log(a); // undefined ์ถ๋ ฅconsole.log(b); // error var a = 'hello';const b = 'hello2';cs 12345678910func1(); // hello ์ถ๋ ฅfunc2(); // error function func1() { // ํจ์์ ์ธ๋ฌธ console.log("hello");} var func2 = functi.. ์ด์ 1 ๋ค์