35 lines
834 B
HTML
35 lines
834 B
HTML
<!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>
|
||
// 函数声明
|
||
function add(x,y){
|
||
// x,y => 形参
|
||
console.log(x+y)
|
||
return //return 语句就是函数的结束语句 他后面的语句一定是不执行的
|
||
console.log("五一过完了")
|
||
}
|
||
|
||
// 函数表达式
|
||
var add1=function(x,y){
|
||
console.log(x+y)
|
||
}
|
||
|
||
var result=add1(1,2);
|
||
// 1,2 实参
|
||
console.log(result);
|
||
|
||
(function(){
|
||
document.write("lijizhixing")
|
||
})();
|
||
|
||
</script>
|
||
</head>
|
||
<body>
|
||
|
||
</body>
|
||
</html> |