I\'m wondering how to merge these JS if/else statements correctly? if (window.addEventListener) { window.addEventListener(\'dosomething\', foo, false); }