function eventHandler(e) { if (!e) e = window.event;}//可以替换为:function eventHandler(e) { e = e || window.event;} if (myobj) { doSomething(myobj);}//可以替换为:myobj && doSomething(myobj);