Notice
Recent Posts
Recent Comments
Link
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

chapter08 : 콜백함수 본문

WEB.JS/04.함수_JS

chapter08 : 콜백함수

GAWON 2023. 5. 19. 09:35
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
[//1.선언적](https://1.xn--6i4b27ff4b/) 함수 정의
function callback() {
document.write("callback 함수 호출");
}
[//2.다른](https://2.xn--2j1bu8j/) 선언적 함수 정의
function callTenTimes(func) {  //매개변수 : func는 함수 저장할 변수
for(var n = 0; n < 10; n++){
func(); //callback();
}
}
[//3.다른](https://3.xn--2j1bu8j/) 선언적 함수 호출
callTenTimes(callback);//첫 번째 선언적 함수를 전달 (괄호없이 이름만 전달)

</script>
</head>
<body>

</body>
</html>

'WEB.JS > 04.함수_JS' 카테고리의 다른 글

chapter10 : 타이머_내장함수  (0) 2023.05.19
chapter09 : 재귀함수  (0) 2023.05.19
chapter07 : 스코프  (0) 2023.05.19
chapter06 : 함수사용예제  (0) 2023.05.19
chapter05 : 선언적함수_표현적함수  (0) 2023.05.19