So im using... even don't know how to call this feature, but it looks like variable/id for events.
So in jquery i can do like this
$('.button').off('.buttonClick').on('click.buttonClick', function() {
console.log("blahblahblah")
})
So first i remove specific event(.buttonClick) from this button then add.
This helps me prevent leaks from some Libraries that we are using.
How to do something like this in vanilla javascript?
==========Added==========
The point is removing a specific same event listeners. So for example if i have two different 'click' event listeners, i will remove only that what i need to remove, but not others. So if i type
$(document).on('click.docClick1', function() {
console.log("1")
})
$(document).on('click.docClick2', function() {
console.log("2")
})
$(document).on('click.docClick3', function() {
console.log("3")
})
And then type
$(document).off('.docClick2')
First and third 'click' event listeners will remain.