Function
ํจ์ ๊ฐ์ฒด
๊ฐ์ฒด ์ค์์ ๊ฐ์ฒด ๋ฆฌํฐ๋ด๋ก ์์ฑ๋๋ ๊ฐ์ฒด๋ Object.prototype์ ์ฐ๊ฒฐ๋์ง๋ง ํจ์ ๊ฐ์ฒด๋ Function.prototype์ ์ฐ๊ฒฐ๋๋ค
Function์ Object.prototype์ ์ฐ๊ฒฐ๋๋ค
๋ชจ๋ ํจ์๋ ์จ๊ฒจ์ ธ ์๋ ๋ ๊ฐ์ง ์์ฑ - context, code - ์ ๊ฐ๋๋ค
๋ชจ๋ ํจ์ ๊ฐ์ฒด๋ prototype์ด๋ผ๋ ์์ฑ์ด ์๋ค
์ด ์์ฑ์ ๊ฐ์ ํจ์ ์์ฒด๋ฅผ ๊ฐ์ผ๋ก ๊ฐ๋ contructor๋ผ๋ ์์ฑ์ด ์๋ ๊ฐ์ฒด๋ค
ํจ์๋ ๊ฐ์ฒด์ด๊ธฐ ๋๋ฌธ์ ๋ค๋ฅธ ๊ฐ๋ค์ฒ๋ผ ์ฌ์ฉํ ์ ์๋ค
ํจ์๋ ๋ณ์๋ ๊ฐ์ฒด, ๋ฐฐ์ด ๋ฑ์ ์ ์ฅ๋๋ฉฐ, ๋ค๋ฅธ ํจ์์ ์ ๋ฌํ๋ ์ธ์๋ก๋ ์ฌ์ฉํ๊ณ ํจ์์ ๋ฐํ๊ฐ์ผ๋ก๋ ์ฌ์ฉํ๋ค
ํจ์ ๋ฆฌํฐ๋ด
Last updated
Was this helpful?