美文网首页
2019-01-17 判断对象是否为空

2019-01-17 判断对象是否为空

作者: 1e6c2b3901b0 | 来源:发表于2019-01-17 14:32 被阅读0次

    判断对象是否为空,若为空,则为其赋以{}
    this._events = this._events || {};
    遍历对象属性:

     for (let type in types) {
            // we don't process space-separated events here for performance;
            // it's a hot path since Layer uses the on(obj) syntax
            this._on(type, types[type], fn);
    

    相关文章

      网友评论

          本文标题:2019-01-17 判断对象是否为空

          本文链接:https://www.haomeiwen.com/subject/qudidqtx.html