<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>closure</title>
<script type="text/javascript">
function fn(){
var n = '123';
return function(){
console.log(n);
}
}
var a = fn();//把返回值匿名函数给a
a();//调用a就是调用fn中返回的匿名函数
//本例已经通过验证
</script>
</head>
<body>
</body>
</html>