1.0.3 • Published 3 years ago

weiyao-jasmine-utils v1.0.3

Weekly downloads
141
License
MIT
Repository
-
Last release
3 years ago

工具库

  • js常用工具

方法

  • addEventListener : 事件委托
  • apply : this指向
  • bind : this指向
  • call : this指向
  • cancat : 数组连接
  • chunk : 数组分块
  • debounce : 函数防抖
  • throttle : 函数节流
  • deepCopy : 深拷贝
  • ShallowCopy : 浅拷贝
  • drop : 删除数组中左边部分
  • dropRight : 删除数组中右边部分
  • eventBus: 事件总线
  • every : 数组有一个不满足条件就为false
  • some : 数组有一个满足条件就为true
  • filter : 数组过滤器
  • find : 查找数组中符合条件的第一个元素
  • findIndex :查找数组中符合条件的第一个元素的下标index
  • flat : 数组扁平化
  • map : 数组中的元素为原始数组元素调用函数处理后的值
  • mergeObject : 合并对象
  • myInstanceOf : 判断是否是一个对象
  • newInstance : 创建新的实例
  • PubSub : 发布/订阅
  • pull :删除原数组中与value相同的元素, 返回所有删除元素的数组
  • reduce : reduce 方法相同
  • reverseString : 字符串倒序: reverseString(str) 生成一个倒序的字符串
  • palindrome : palindrome
  • truncate :截取字符串: truncate(str, num) 如果字符串的长度超过了num, 截取前面num长度部分, 并以...结束
  • slice: 截取数组
  • unique : 数组去重

作者

@author:weiyao-jasmine @email:179239190@qq.com