// 나쁜 예
if(type === 1) {
window.addEventListener("event", event1);
} else (type === 2) {
window.addEventListener("event", event1);
}
// 좋은 예
window.addEventListener("event", function () {
if(type === 1) {
// 분기처리
} else if(type === 2) {
// 분기처리
}
});