zoukankan      html  css  js  c++  java
  • forEach兼容ie8

    if ( !Array.prototype.forEach ) {

        Array.prototype.forEach = function forEach( callback, thisArg ) {
            var T, k;
            if this == null ) {
                throw new TypeError( "this is null or not defined" );
            }
            var O = Object(this);
            var len = O.length >>> 0;
            if typeof callback !== "function" ) {
                throw new TypeError( callback + " is not a function" );
            }
            if ( arguments.length > 1 ) {
                T = thisArg;
            }
            k = 0;
            while( k < len ) {
     
                var kValue;
                if ( k in O ) {
                    kValue = O[ k ];
                    callback.call( T, kValue, k, O );
                }
                k++;
            }
        };
    }
  • 相关阅读:
    sql server 获取本月的始末时间
    超时时间已到
    sql server定时自动备份
    创建连接服务器
    date制作电子时钟
    C#继承(三)
    C# Split分割
    Dom动态添加属性
    date制作电子时钟(二)
    全局遮罩 shade
  • 原文地址:https://www.cnblogs.com/gudun/p/9184197.html
Copyright © 2011-2022 走看看