var varName = 'variant';
//浏览器环境
console.log(window.varName); // => variant
console.log(self.varName); // => variant
// 通用环境下
console.log(this.varName); // => variant
//Node 环境下
console.log(global.varName); // 报错
let letName = 'letName';
console.log(window.letName); //undefined
console.log(this.letName) //undefined