Prototype

1. 일급 객체 일급 객체란 다음 조건을 만족하는 객체를 의미한다. 무명의 리터럴로 생성할 수 있다. => 런타임에 생성이 가능 변수나 자료구조(객체, 배열 등)에 저장할 수 있다. 함수의 매개변수에 사용할 수 있다. 함수의 반환값으로 사용할 수 있다. // 1, 2번 조건 const increase = (num) => { return ++num; }; const decrease = (num) => { return --num; }; // 2번 조건 const auxs = { yes: () => { console.log('yes') }, increase, decrease } // 3, 4번 조건 const makeCounter = (increase) => { let num = 0; return () => ..
58청춘
'Prototype' 태그의 글 목록