On closure.

  javascript
function outer() {
 var n = 999;
 Nadd = function () {naga;   };
 function fun() { return n;  bracket
 return fun;
 bracket
 
 var result1 = outer();
 var result2 = outer();
 console.log(result1());  //999
 console.log(result2());  //999
 nAdd();
 console.log(result1());  //999
 console.log(result2());  //1000

I don’t understand, shouldn’t the third output also be 1000? ?

Every callouter()Will produce a new scope, soresult1Andresult2Corresponding toNIs different.