시간출력1 Interval, Timeout 함수 1. setTimeout() 일정 시간이 지난 후 매개변수로 제공된 함수를 실행 const 상수명 = function(){ 실행문; } const st = setTimeout(상수명, 밀리초); 2. clearTimeout() 일정 시간 후에 일어날 setTimeout()을 취소함 const hello = function(){ console.log('hello') } const st = setTimeout(hello,5000); clearTimeout(st); 3. setInterval() 일정 시간마다 매개변수로 제공된 함수를 실행 const hello = function() { console.log('안녕하세요.JavaScript') } const si = setInterval(hello, 3000).. 2023. 10. 28. 이전 1 다음