Variables in a IIFE

后端 未结 0 1022
孤城傲影
孤城傲影 2020-12-13 13:52

I am trying to understand closures in Javascript. I came across this example :

var add = (function () {
  var counter = 0;
  return function () {counter += 1;         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题