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,也不能打断遍历

  • 相关阅读:
    Minimum configuration for openldap to proxy multiple AD into a single search base
    排列组合算法(PHP)
    Make Notepad++ auto close HTML/XML tags after the slash(the Dreamweaver way)
    PHP, LDAPS and Apache
    【day1】tensorflow版本问题及初步使用
    tflearn save模型异常
    布隆过滤器(Bloom Filter)
    初识Spark(Spark系列)
    Hadoop实践
    install postgis(2.0) on ubuntu(12.04)
  • 原文地址:https://www.cnblogs.com/fsy0718/p/3288099.html
Copyright © 2011-2022 走看看