2024年 4月
1234567
891011121314
15161718192021
22232425262728
2930  

近期发布

近期评论

    2024 年 4 月 23 日

    Neusofts

    科技改变生活,创新引领未来

    Underscore.js

    Underscore是一个非常实用的JavaScript库,提供许多编程时需要的功能的支持,他在不扩展任何JavaScript的原生对象的情况下提供很多实用的功能。

    创造一个小而美的公司非常值得尊敬,小而美的框架同样散发着那样的令人着迷的魅力。

    无论你写一段小的js代码,还是写一个大型的HTML5应用,underscore都能帮上忙。目前,underscore已经被广泛使用,例如,backbone.js唯一强依赖的库就是underscore.js

    Underscore提供的60多个函数:
    http://www.css88.com/doc/underscore/ Collections(集合)
    each
    map
    reduce
    reduceRight
    find
    filter
    reject
    all
    any
    include
    invoke
    pluck
    max
    min
    sortBy
    groupBy
    sortedIndex
    shuffle
    toArray
    size Arrays(数组)
    first
    initial
    last
    rest
    compact
    flatten
    without
    union
    intersection
    difference
    uniq
    zip
    indexOf
    lastIndexOf
    range

    Functions(函数)
    bind
    bindAll
    memoize
    delay
    defer
    throttle
    debounce
    once
    after
    wrap
    compose

    Objects(对象)
    keys
    values
    functions
    extend
    defaults
    clone
    tap
    isEqual
    isEmpty
    isElement
    isArray
    isArguments
    isFunction
    isString
    isNumber
    isBoolean
    isDate
    isRegExp
    isNaN
    isNull
    isUndefined

    Utility(功能)
    noConflict
    identity
    times
    mixin
    uniqueId
    escape
    template

    Chaining
    chain
    value
    具体每个函数的用途,你可以看上面中文的文档(翻译的不是太好),也可以看
    http://underscorejs.org/