Skip to content

Commit b14d5ab

Browse files
committed
初识
1 parent 14825b5 commit b14d5ab

4 files changed

Lines changed: 396 additions & 344 deletions

File tree

函数初识/1.函数定义.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//function语句的定义方法
2+
function test1(arg1,arg2){
3+
console.log("function语句的定义方法:",arg1+arg2);
4+
}
5+
6+
//函数直接量的定义方法
7+
var test2 = function(arg1,arg2){
8+
console.log("函数直接量的定义方法:",arg1+arg2);
9+
};
10+
var utility={
11+
init:function () {
12+
console.log("执行")
13+
}
14+
};
15+
16+
//构造函数的定义方法
17+
var test3 = new Function("arg1","arg2","console.log('构造函数的定义方法:',arg1+arg2)");

函数初识/2.toString.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
console.log(test1.toString());
2+
3+
function test1(){
4+
console.log("最开始的调用方法");
5+
}

0 commit comments

Comments
 (0)