[removed] enumerate global vars

前端 未结 3 905
南旧
南旧 2021-01-27 05:52
a = 123; // becomes global var

var b = 234; // local var

function f() {} // local func

g = function() {} // got a global func

now how to print

3条回答
  •  旧时难觅i
    2021-01-27 06:29

    Globals become attached to the global object, which in a browser is the window.

    a = 123
    

    is the same as

    window.a = 123
    

提交回复
热议问题