闭包

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
function f1(){
var num=10;
//函数的声明
function f2(){
console.log(num);
}
//函数调用
f2();
}
f1();
</script>
</head>
<body>

</body>
</html>
posted @ 2019-02-13 14:05  燕十三丶  阅读(136)  评论(0编辑  收藏  举报
AmazingCounters.com