在ES5中,我可以检查窗口对象上是否存在“类”(构造函数):if(window.MyClass){...//dosomething}在ES6中,accordingtothisarticle,全局声明的类是全局的,但不是全局对象的属性(window,在浏览器上):Buttherearenowalsoglobalvariablesthatarenotpropertiesoftheglobalobject.Inglobalscope,thefollowingdeclarationscreatesuchvariables:letdeclarationsconstdeclarationsClas