var handler_some = document.addEventListener('click', function (e) {
this.removeEventListener('click', handler_some );
});
function handler(e) {
console.log('hello, world!!');
this.removeEventListener(e.type, handler);
}
document.addEventListener('click', handler);
document.addEventListener('click', handler, { once: true });
let fn = function (e) {
document.removeEventListener('click',fn);
}
document.addEventListener('click', fn);