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

2019-01-17  本文已影响0人  1e6c2b3901b0

判断对象是否为空,若为空,则为其赋以{}
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);
上一篇下一篇

猜你喜欢

热点阅读