jaimex8
4/25/2016 - 6:37 PM

Closure function

Closure function

var test = 1;
(function(test){
    setTimeout(function() {    console.log('closure test is '+test);}, 1000);
})(test);
test = 2;
console.log('test is '+test )