JavaScript explain two face questions

A function is a scope, the scope has been formed in the code compile time

Object-oriented js: function Fun () {} class is capitalized

      obj = new Fun () to instantiate

window is the object of the entire global variables

js no dictionary, only the object

Since execution of the function (function () {console.log (that.Name)}) ()

obj.Func=function(){this}  this是obj

(Function () {this}) () this is window-- "Global Variables

Guess you like

Origin www.cnblogs.com/jintian/p/11210731.html