npm i nicecode-utils --save
*全局对象: utils
*方法:
(1). debounce(callback, time) 防抖
参数: callback回调函数, time等待时间
(2). throttle(callback, wait) 节流
参数: callback回调函数, wait等待时间
(3). clone(target) 浅拷贝
参数: target目标对象
(4). deepClone(target, map=new Map()) 深拷贝
参数: target目标对象, map:解决对象属性循环引用问题(不需要传此参数)
(5). unique (array) 数组去重
参数: array 目标数组