Coder Social home page Coder Social logo

kule2018 / js-function-libiary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roger1492/js-function-libiary

0.0 1.0 0.0 134 KB

打造自己的JavaScript代码库,片段,函数,以备将来之用,代码持续添加中

JavaScript 100.00%

js-function-libiary's Introduction

代码集合库

数组 Array

中文 英文
在数组随机选择一个元素 choice
把数组分成指定个数的n组 chunk
删除所有数组元素为falsy的值 compact
从array数组返回other数组中没有的值 difference
删除数组前面指定个数的元素 drop
删除数组后面指定个数的元素 drop right
通过索引交换数组中的两个值 exchange by index
返回数组中的第一个元素 first element
二维数组一维化(扁平化) flatten
把多个数组列表**同拥有的元素筛选出来组成一个新数组 // TOTO intersection
把数组转化为带分隔符的字符串 join
返回数组中的最后一个元素 last element
对象拆分成数组对 pairs
删除数组中指定元素 remove
统计数组中相同元素出现的次数 repeat count
从数组中随机选出n个元素组成一个新的数组 sample
乱序 shuffle
数组去重 delete repeat array
删除数组中任意位置的元素,返回新数组 without
返回两个数组中的不同元素组成的新数组 xor
数组的对应项组成新的数组 zip

数学 Math

中文 英文
阶乘(递归函数) Factorial
斐波那契数列 Fibonacci
最大数 Maximum Number
最小数 Minimum Number
进制转换 Positional Notation
数组求和 Sum

对象 Object

中文 英文
返回集合的长度或者是可迭代字符串的长度 size
浅拷贝 shadow copy
深拷贝 deep copy

随机方法 Random

中文 英文
随机生成颜色 random color
随机生成n个IP地址 random IP
生成指定范围内的随机数 random number

排序 Sort

中文 英文
冒泡排序 Bubble Sort
桶排序 Bucket Sort
计数排序 Counting Sort
堆排序 Heap Sort
插入排序 Insertion Sort
归并排序 Merge Sort
快速排序 Quick Sort
基数排序 Radix Sort
选择排序 Selection Sort
希尔排序 Shell Sort

字符串 String

中文 英文
字母大小写切换 change case
在原始字符串的后面填充指定长度的字符串 pad end
在原始字符串的前面填充指定长度的字符串 pad start
生成指定数量的字符串 repeat
逆转字符串 reverse
字符串分组 group

工具库 tools

中文 英文
5星的打分评测系统 rating
根据keycode获得键名 get key name
根据keyName获得keyCode get key code
二分法查找 binary search
去除字符串中的空格 trim
敏感词处理 sensitive
去除字符串中的所有空格 trim all
调换两个值的位置 exchange
生成指定范围内的数字 range

验证方法 Validate

中文 英文
是否为Email地址 is email
是否为IP地址 is IP
判断类型 is type
判断是否为元素类型 is Element
判断类型 type

js-function-libiary's People

Contributors

roger1492 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.