if (controller && typeof controller.processGestureLeft === "function") {
                    controller.processGestureLeft.call(controller);
                }

这里后面的typeof已经包含了前面,前面controller是真已经不需要写了。

 

if (app.runtimeData.homeType === undefined) {
            app.runtimeData.homeType = 1;
        }

这种写法没有下面这样好:

if (typeof app.runtimeData.homeType === "undefined") {
            app.runtimeData.homeType = 1;
        }

 

posted on 2015-05-15 15:42  meeming  阅读(132)  评论(0)    收藏  举报



Fork me on GitHub