-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path函数定义.html
More file actions
37 lines (33 loc) · 766 Bytes
/
函数定义.html
File metadata and controls
37 lines (33 loc) · 766 Bytes
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
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
// 函数定义
function func(a, b){
// 显式声明形参
// console.log(a+b);
return a + b;
}
function func1(){
// 隐式声明形参
for (var i = 0; i < arguments.length; i++){
console.log(arguments[i]);
}
}
var f2 = function (){
// 匿名函数定义
console.log("匿名函数");
return 123;
}
// 函数调用
var f = func(1, 2);
console.log(f);
func1(1,2,3,4,5,6,7,8);
console.log(f2());
</script>
</head>
<body>
</body>
</html>