Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Underscore Javascript Library

1. 说明

自己实现underscore库中的所有方法

2. 结构

Collections                      搜集类方法
    - each
    - map
    - reduce
    - reduceRight
    - find
    - filter
    - where
    - findWhere
    - reject
    - every
    - some
    - contains
    - invoke
    - pluck
    - max
    - min
    - sortBy
    - groupBy
    - indexBy
    - countBy
    - shuffle
    - sample
    - toArray
    - size
    - partition

Arrays                            数组类方法
    - first
    - initial
    - last
    - rest
    - compact
    - flatten
    - without
    - union
    - intersection
    - difference
    - uniq
    - zip
    - unzip
    - object
    - chunk
    - indexOf
    - lastIndexOf
    - sortedIndex
    - findIndex
    - findLastIndex
    - range

Functions                        函数类方法
    - bind
    - bindAll
    - partial
    - memoize
    - delay
    - defer
    - throttle
    - debounce
    - once
    - after
    - before
    - wrap
    - negate
    - compose
    - restArguments

Objects                          对象类方法
    - keys
    - allKeys
    - values
    - mapObject
    - pairs
    - invert
    - create
    - functions
    - findKey
    - extend
    - extendOwn
    - pick
    - omit
    - defaults
    - clone
    - tap
    - has
    - property
    - propertyOf
    - matcher
    - isEqual
    - isMatch
    - isEmpty
    - isElement
    - isArray
    - isObject
    - isArguments
    - isFunction
    - isString
    - isNumber
    - isFinite
    - isBoolean
    - isDate
    - isRegExp
    - isError
    - isSymbol
    - isMap
    - isWeakMap
    - isSet
    - isWeakSet
    - isNaN
    - isNull
    - isUndefined

Utility                          工具类方法
    - noConflict
    - identity
    - constant
    - noop
    - times
    - random
    - mixin
    - iteratee
    - uniqueId
    - escape
    - unescape
    - result
    - now
    - template

Chaining                        链式调用方法
    -chain
    -value

About

用自己的思路写一遍underscore中的函数

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages