1. Property value shorthand / Constructor function // 3. Property value shorthand const person1 = {name : 'aa', age : 2}; const person2 = new Person('bb',11); console.log(person1); // {name: "aa", age: 2} console.log(person2); // Person {name: "bb", age: 11} // 4. Constructor function function Person(name, age) { this.name = name; this.age = age; } 2. key 값이 있는지 체크 (in operator: property existen..
타이머 관련 함수 setTimeout(function, millisecond) - 일정시간 후 함수를 한번 실행 setInterval(function, millisecond) - 일정 시간마다 함수를 반복해서 실행 clearTimeout(id) - 일정 시간 후 함수를 한 번 실행하는 것을 중지한다. clearInterval(id) - 일정 시간마다 함수를 반복하는 것을 중단한다. 예시) 2초마다 실행하는 걸 10초후 setTImeout함수를 실행해서 멈춘다. hello script