判断当前脚本的环境,可以判断Global对象是否为window,如果是则表明当前环境是浏览器环境,如果不是则表示当前环境是node环境。 this === window ? "browser" : "node"