var events = {
addEvent: function(element, type, fn, capture){
element.addEventListener(type, fn, capture);
},
removeEvent: function(){
element.removeEventListener(type, fn, capture);
}
}
I'm loking for something like this in object literal definition to reduce the code the event Object is just an example
var events = {
[action + "Event"]: function(element, type, fn, capture){
element[action + "eventListener"](type, fn, capture);
}
}
}
I know there are other options like
element.events.add(....) , element.events.remove(....)
or this option
element.events("add", type, fn, capture) / element.events("remove", type, fn, capture)