callee (1) 썸네일형 리스트형 자바스크립트 함수 안에서 정적변수 초기화 목적 함수 내에서 한 번만 초기화가 필요한 변수를 만들고 재사용을 도모한다. 실습 - 트레디셔널한 방법 function Test(){ if(!Test.prototype.val ){ Test.prototype.val = "hello"; console.log("초기화 됨"); } } Test(); console.log(Test.prototype.val); - 직감적인 방법 function Test(){ if(!Test.val ){ Test.val = "hello"; console.log("초기화 됨"); } } Test(); console.log(Test.val); - 익스트림한 방법 function Test(){ if(!arguments.callee.val ){ arguments.callee.val = ".. 이전 1 다음