We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
js & node env checker
"use strict"; /** * * @author xgqfrms * @license MIT * @copyright xgqfrms * @created 2019-11-14 * * @description 写个方法判断当前脚本运行在浏览器还是node环境中 js * @augments * @example * @link https://github.com/haizlin/fe-interview/issues/1514#issuecomment-553188594 * */ let log = console.log; log(`js env`, typeof window === 'undefined' ? 'Node' : 'Browser'); log(`Node global`, global); log(`Browser window`, window); // ReferenceError: window is not defined
The text was updated successfully, but these errors were encountered:
No branches or pull requests
js env check
The text was updated successfully, but these errors were encountered: