Props and State
// pure function์ด ์๋ ์ด์ ๋ ์ธ๋ถ์ ์ํฅ์ ์ฃผ๊ธฐ ๋๋ฌธ์ ์ด๋ ๋ถ์ํจ๊ณผ๋ผ ํจ
const obj = {key: 1}
function change (value: number) {
obj.key = value
}
// pure function์ ์ธ๋ถ์ ์ํฅ์ ์ฃผ์ง ์๊ณ ์ฃผ์ด์ง ๊ฐ์ผ๋ก ๊ณ์ฐํ์ฌ ์์๋๋ ๊ฒฐ๊ณผ ๊ฐ์ ์ ๊ณต
function add (a:number, b:number):number {
return a + b;
}Last updated