SOURCE

function throttle(fn,limit){
    let timer=false
    return function(...args){
        if(!timer){
             fn.apply(this,args)
            timer=true
            setTimeout(()=>{
                timer=false
            },limit)
             
        }
    }
}
function debounce(fn,limit){
    let timer=null
    return function(...args){
        if(timer)clearTimeout(timer)
        timer=setTimeout(()=>{
            fn.apply(this,args)
        },limit)
    }
}
const tothrottle=(e)=>console.log(e)
throttle(tothrottle('1111'),2000)


function clonedeep(obj){
    if(obj===null||typeof obj!='object')return obj;
    let clone=Array.isArray(obj)?[]:{}
    for(let key in obj){
        if(obj.hasOwnProperty(key)){
            clone[key]=clonedeep(obj[key])
        }
    }
    return clone
}
let a={a:1,b:{c:2,d:3}}
let b=clonedeep(a)
// console.log(a,'aaaaa')
// console.log(b,'bbbbbb')

const {foo:bar,bar:foo}={foo:2,bar:3}
console.log(foo,bar)
console 命令行工具 X clear

                    
>
console