파일 목록
-
📁 이후
-
📁 jquery
-
📁 js
- ex10-1.html
- ex10-2.html
- ex10-5.html
- ex8-11.html
- Ex8-4.html
- Example8-2.html
- example9-18.html
- example9-19.html
- Examplt8-3.html
- exapmle9-21.html
- practic9-4.html
- practice 9-6.html
- practice8-1-3.html
- practice8-2.html
- practice8-3.html
- practice8-5.html
- practice8-6.html
- practice8-7.html
- practice9-1.html
- practice9-5.html
- practice9-8.html
- test6.html
- Test8.html
- test9.html
- test9_10.html
- test9_3.html
- test_9._0.html
- win1_ob2.html
- 챌린지 copy.html
-
- desktop.ini
- ex10-1,2.html
- ex10-3.html
- ex10-5.html
- Title.png
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- <script>
let multiplyAll = function (a, b) {
let output = 1;
for (let i = a; i <= b; i++) {
output *= i
}
return output
}
document.write(`${multiplyAll(1, 2)} <br>`);
// console.log(multiplyAll(1, 3));
document.write(`${multiplyAll(1, 3)} <br>`);
</script> -->
<!-- 최대값을 찾는 max() 함수 만들기-->
<!-- <script>
const max = function (array) {
let output = array[0];
for (const data of array) {
// 해당 방식으로 배열을 넣으면 자동으로 배열이 for문으로 돌아감
if (output < data) {
output = data;
}
} return output;
}
document.write(max([1, 2, 3, 4]))
</script> -->
<!--배열 max[1,2,3,4]형태, 숫자 매개변수 max(1,2,3,4) 형태 둘 다 입력할 수 있는 max()함수 만들기-->
<!-- <script>
const max = function (first, ...rests) {
let output;
let items;
if (Array.isArray(first)) {
output = first[0];
items = first;
} else if (typeof (first) === 'number') {
output = first;
items = rests;
}
for (const data of items) {
if (output < data) {
output = data;
}
}
return output;
}
document.write(`max(배열): ${max([1, 2, 3, 4])} <br>`);
document.write(`max(숫자, ...): ${max(1, 2, 3, 4)}`);
</script> -->
<!--콜백함수-->
<!-- <script>
function callThreeTimes(callback) {
for (let i = 0; i < 3; i++) {
callback(i);
}
}
function print(i) {
document.write(`${i}번째 함수 호출 <br>`);
}
// 함수를 호출
callTreeTimes(Print);
</script> -->
<!--두번째 방법-->
<!-- <script>
// 함수를 선언
function callThreeTimes(callback) {
for (let i = 0; i < 3; i++) {
callback(i)
}
}
// 함수를 호출
callThreeTimes(function (i) {
console.log(`${i}번째 함수 호출`)
})
</script> -->
<!--forEach() 자체콜백-->
<!-- 중간고사 나온 적 있음-->
<script>
const numbers = [273, 52, 103, 32, 57];
numbers.farEach(function (value, index, array) {
document.write(`${인덱스}번째 요소 : ${value} <br>`);
})
</script>
</head>
<body>
</body>
</html>