博客
关于我
在所有情况下取到顶层对象
阅读量:320 次
发布时间:2019-03-04

本文共 415 字,大约阅读时间需要 1 分钟。

方法一

(typeof window !=="undefeated" ? window  : (    typeof process === "object"&&    typeof require === "function"&&    typeof global === "object"   )   ?global    :this )

方法二

var getGlobal = function (){     if(typeof self !=="undefeated"){   return self }  if(typeof window !=="undefined"){   return window}  if(typeof global !=="undefined"){   return global }  throw new Error("unable to locate global object ")}

转载地址:http://uvsh.baihongyu.com/

你可能感兴趣的文章
pd.resample('B')指重采样为工作日
查看>>
债券中的久期是什么意思
查看>>
MA、WMA、EMA、EXPMA区别及公式详述
查看>>
阿里云云解析DNS各种概念深度剖析
查看>>
(20200328已解决)从docker容器内复制文件到宿主机
查看>>
理解Docker ulimit参数
查看>>
Factor Exposure因子暴露
查看>>
理解DSL||AST||query clauses||X-Pack||JDBC||ODBC
查看>>
将DataFrame作为邮件正文HTML发送 in Python
查看>>
理解Library of Congress Cataloging-in-Publication Data
查看>>
理解Python系统下的时间格式
查看>>
《经济机器是怎样运行的》笔记(三)
查看>>
Python提升回测速度concurrnet.futures模块详解
查看>>
Python语言'类'概念再理解
查看>>
(2019.6.27)Anaconda清华镜像已恢复使用
查看>>
Robomongo使用教程:踩着前辈的路
查看>>
Python中Class类与def函数的区别
查看>>
OpenAI Gym简介及初级实例
查看>>
用Matplotlib和Gym优雅地呈现股票交易智体
查看>>
Github上量化交易相关项目汇总
查看>>