Files
ClassContent/历届学生/韩一伟/每天课程/2021-07-05/函数.html
2024-09-27 02:06:13 +08:00

51 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>函数</title>
</head>
<body>
</body>
<script>
// 函数 function 方法
// 作用:把使用效率高的很多代码放到一起,降低冗余
// function 方法名 (方法参数) { 你的代码 }
// function xiyifu(m1,m2,m3,m4) {
// console.log(m1,m2,m3,m4);
// // console.log(arguments);
// console.log("洗衣服中...");
// return "干净的衣服给你"
// }
// var a = xiyifu(3,2,1);
// console.log(a);
// 匿名函数
// var xiyifu = function () {
// console.log("洗衣服");
// }
// var c = xiyifu;
// console.log(c);
// 局部作用域
// 全局作用域
// 定义变量加var那么这个变量会受到所在位置的作用域影响
// 没有var 变量提升
// var ddd = 1
// var c = function () {
// ddd = 1
// console.log(ddd); // 1
// }
// c();
// console.log(ddd); // 1
</script>
</html>