스케줄링
setTimeout:일정시간뒤 실행
serInterval:인터벌간격으로 계속 실행.
function test(){
alert("hello");
}
let timer = setInterval(test,3000 );
******************************************
result: test함수를 3초마다 실행.
스케줄링 초기화.
setTimeout(() => {
clearInterval(timer);
}, 5000);
*******************************
<b> result: 5초 뒤 timer변수 반복 초기화. </b>