deprecate .add/removeEventListener(...) in pro of .on/off(...)

# manuelbarzi (14 days ago)

make it shorter, simpler and more handy

deprecate this

EventTarget.addEventListener(...)
EventTarget.removeEventListener(...)

in pro of

EventTarget.on(...)
EventTarget.off(...)

make it easier, more intuitive and more readable

button.on(‘click’, e => ...)

form.on('submit', e => ...)

document.on('DOMContentLoaded', () => ...)
...

(and reduce code length)

# Jordan Harband (14 days ago)

Neither of these methods, nor the DOM itself, are part of the JS language standard - you might be thinking of the HTML standard.

# Isiah Meadows (14 days ago)

It is part of the DOM itself: dom.spec.whatwg.org/#interface-eventtarget. Doesn't make this any more on-topic here, though.


Isiah Meadows contact at isiahmeadows.com, www.isiahmeadows.com

# Tab Atkins Jr. (14 days ago)

Jordan meant that DOM isn't part of the JS standard. ^_^ So yeah, not relevant to this list.

# Isiah Meadows (14 days ago)

Oh okay. I misread his response, then.

Isiah Meadows contact at isiahmeadows.com, www.isiahmeadows.com