写出以下代码的运行结果,支出此代码的不足之处并且给出优化建议

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
function fn(){
var n = 0;
function m(){
n += 1;
console.log(n);
}
return m;
}
var result = fn();
result();
result();
result();
result();
result();
result();
result = null;
result();
</script>
</head>
<body>

</body>
</html>
posted on 2019-01-09 09:55  猛兽  阅读(205)  评论(0编辑  收藏  举报