语法格式
function 函数名(参数){
结构体
}
函数名();
声明并调用
function qqq(){
console.log(95722);
console.log(11111);
console.log(888555);
}
qqq();

调用多次
function qqq(){
console.log(95722);
console.log(11111);
console.log(888555);
}
qqq();
qqq();

使用参数声明变量
function sum(a,b){
console.log(a + b);
}
sum(3,4);
sum("3",4);


终止执行
function fun(){
console.log(111);
console.log(222);
return;
console.log(554);
console.log(977);
}
fun();

函数的返回值
function ss(a,b){
return a + b;
}
console.log(ss(1,2));

返回值作为参数
function ss(a,b){
return a + b;
}
var qq = ss(3,4);
console.log(qq);
console.log(ss(2,ss(3,4)));

变量名调用function函数
var foo = function fun(){
console.log(1);
};
var foo2 = function (){
console.log(2);
};
foo();
foo2();

返回结果并相加

function c(q,w){
return q + w;
};
var qw = c(111,222);
console.log(qw);