function test2()
                {
                    var scope = "global scope";
                    var f = enclose(scope);
                    scope = 'aaa';
                    alert(f());
                }
                
                function enclose(word)
                {
                    function f()
                    {
                        return word;
                    }
                    return f;
                }
                test2();

 

相关文章:

  • 2021-11-16
  • 2021-06-12
  • 2021-06-14
猜你喜欢
  • 2022-02-10
  • 2021-07-19
  • 2022-12-23
  • 2021-11-20
  • 2021-11-18
  • 2021-11-22
  • 2021-05-03
相关资源
相似解决方案