判断当前脚本运行环境,是浏览器还是node 2019-03-28 本文已影响0人 Mr君 node环境:global对象undefined 浏览器环境:global对象不为window,则一定不是浏览器环境