JavaScript-utils ============ > JavaScript工具函数库 ## array * arrayDisorder  [打乱数组顺序](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/arrayDisorder.js) * arrayEqual  [判断两个数组是否相等](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/arrayEqual.js) * arrayFlattening  [数组扁平化](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/arrayFlattening.js) * arrayRandom  [从数组中随机获取元素](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/arrayRandom.js) * arrayRemoveRepeat  [数组去重](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/arrayRemoveRepeat.js) * arraySum  [数组求和(数字类型的数组)](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/arraySum.js) * getCount  [返回数组(或字符串)中出现最多的元素和出现次数](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/getCount.js) * getEleCount  [返回数组或字符串中一个元素出现的次数](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/getEleCount.js) * maxArr  [找出数组中的最大值(数字类型的数组)](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/maxArr.js) * minArr  [找出数组中的最小值(数字类型的数组)](https://github.com/striveDJiang/JavaScript-utils/blob/master/array/minArr.js) ## string * changeCase  [大小写转换](https://github.com/striveDJiang/JavaScript-utils/blob/master/string/changeCase.js) * digitUppercase  [现金额转大写](https://github.com/striveDJiang/JavaScript-utils/blob/master/string/digitUppercase.js) * removeSpace  [字符串去除空格](https://github.com/striveDJiang/JavaScript-utils/blob/master/string/removeSpace.js) * repeatCopy  [字符串重复复制](https://github.com/striveDJiang/JavaScript-utils/blob/master/string/repeatCopy.js) * stringFormat  [格式化字符串](https://github.com/striveDJiang/JavaScript-utils/blob/master/string/stringFormat.js) * stringReplace  [字符串替换](https://github.com/striveDJiang/JavaScript-utils/blob/master/string/stringReplace.js) ## object * dataType  [数据类型判断](https://github.com/striveDJiang/JavaScript-utils/blob/master/object/dataType.js) * deepClone  [深拷贝,支持常见类型](https://github.com/striveDJiang/JavaScript-utils/blob/master/object/deepClone.js) * isEmptyObject  [判断`obj`是否为空](https://github.com/striveDJiang/JavaScript-utils/blob/master/object/isEmptyObject.js) ## function * debounce  [函数防抖](https://github.com/striveDJiang/JavaScript-utils/blob/master/function/debounce.js) * throttle  [函数节流](https://github.com/striveDJiang/JavaScript-utils/blob/master/function/throttle.js) ## dom * addClass  [为元素添加class](https://github.com/striveDJiang/JavaScript-utils/blob/master/dom/addClass.js) * hasClass  [判断元素是否有某个class](https://github.com/striveDJiang/JavaScript-utils/blob/master/dom/hasClass.js) * removeClass  [为元素移除class](https://github.com/striveDJiang/JavaScript-utils/blob/master/dom/removeClass.js) ## bom * getScrollTop  [获取滚动条距顶部的距离](https://github.com/striveDJiang/JavaScript-utils/blob/master/bom/getScrollTop.js) * isSupportWebP  [设置滚动条距顶部的距离](https://github.com/striveDJiang/JavaScript-utils/blob/master/bom/isSupportWebP.js) * offset  [在${duration}时间内,滚动条平滑滚动到${to}指定位置](https://github.com/striveDJiang/JavaScript-utils/blob/master/bom/offset.js) * scrollTo  [获取一个元素的距离文档(document)的位置,类似jQ中的offset()](https://github.com/striveDJiang/JavaScript-utils/blob/master/bom/scrollTo.js) * setScrollTop  [判断浏览器是否支持webP格式图片](https://github.com/striveDJiang/JavaScript-utils/blob/master/bom/setScrollTop.js) ## date * formatPassTime  [格式化${startTime}距现在的已过时间](https://github.com/striveDJiang/JavaScript-utils/blob/master/date/formatPassTime.js) * formatRemainTime  [格式化现在距${endTime}的剩余时间](https://github.com/striveDJiang/JavaScript-utils/blob/master/date/formatRemainTime.js) ## random * randomColor  [随机生成颜色](https://github.com/striveDJiang/JavaScript-utils/blob/master/random/randomColor.js) * randomNum  [生成指定范围随机数](https://github.com/striveDJiang/JavaScript-utils/blob/master/random/randomNum.js) ## regexp * isEmail  [判断是否为邮箱地址](https://github.com/striveDJiang/JavaScript-utils/blob/master/regexp/isEmail.js) * isIdCard  [判断是否为身份证号](https://github.com/striveDJiang/JavaScript-utils/blob/master/regexp/isIdCard.js) * isPhoneNum  [判断是否为手机号](https://github.com/striveDJiang/JavaScript-utils/blob/master/regexp/isPhoneNum.js) * isUrl  [判断是否为URL地址](https://github.com/striveDJiang/JavaScript-utils/blob/master/regexp/isUrl.js) ## url * parseQueryString  [url参数转对象](https://github.com/striveDJiang/JavaScript-utils/blob/master/url/parseQueryString.js) * stringfyQueryString  [对象序列化](https://github.com/striveDJiang/JavaScript-utils/blob/master/url/stringfyQueryString.js) ## cookie * getCookie  [根据name读取cookie](https://github.com/striveDJiang/JavaScript-utils/blob/master/cookie/getCookie.js) * removeCookie  [根据name删除cookie](https://github.com/striveDJiang/JavaScript-utils/blob/master/cookie/removeCookie.js) * removeCookie  [根据name删除cookie](https://github.com/striveDJiang/JavaScript-utils/blob/master/cookie/removeCookie.js) * setCookie  [设置Cookie](https://github.com/striveDJiang/JavaScript-utils/blob/master/cookie/setCookie.js) ## device * getExplore  [获取浏览器类型和版本](https://github.com/striveDJiang/JavaScript-utils/blob/master/device/getExplore.js) * getOS  [获取操作系统类型](https://github.com/striveDJiang/JavaScript-utils/blob/master/device/getOS.js) * getKeyName  [根据keycode获得键名](https://github.com/striveDJiang/JavaScript-utils/blob/master/device/getKeyName.js)