zoukankan      html  css  js  c++  java
  • YUI Array 之each| forEach(遍历)

    1. yui-each原码:

    遍历

    2.tangram-each

    tangram遍历


    3.tangram-array each原码

    tangram array遍历



    4.underscore  each 原码:

    underscore array遍历

    5. qwrap – each 

    qwrap array遍历



    比较

      a. YUI会调用原生的forEach,可以用来遍历array,string,不能遍历object,也不会打断遍历

      b.tangram最严谨,排除了function具有length属性,但YUI与underscore用了in 这个来排除掉了function,可以返回break 或者false打断遍历,可以用来遍历对象

      c.  underscore 会调用原生的forEach,可以用来遍历对象,数组,字符串,可以被打断遍历,这个函数在underscore是一个基础的函数,

      d. qwrap的最简洁,不会调用原生forEach,也不能打断遍历

  • 相关阅读:
    关于codeblocks插件(持续更新)
    自定义gvim配色方案qiucz.vim的源码
    mark it
    poj 1032
    poj 1028
    最小公倍数是lcm
    problems
    hdu 1067
    某些题的做法。。。
    突然明白了什么
  • 原文地址:https://www.cnblogs.com/fsy0718/p/3288099.html
Copyright © 2011-2022 走看看