SOURCE

const whickEvent = (() => {
    if(window.addEventListener){
        return function(element,type,callback,isBubble){
            element.addEventListener(type,(e) => {
                callback.call(element.e)
            },isBubble)
        }
    }else if(window.attachEvent){
        return function(element,type,callback){
            element.attachEvent('on' + type,(e) => {
                callback.call(element,e)
            })
        }
    }
})()
console 命令行工具 X clear

                    
>
console