QiFeng.ZWY.MagWeb/Content/ProportionDiagram/js/lib/common.js
(开头部分) 17KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* Created by liYang on 2017/10/25 0029.
*/
;
(function () {
// forEach兼容性处理
Array.prototype.forEach = Array.prototype.forEach ||
function (fn, context) {
for (var k = 0, length = this.length; k < length; k++) {
if (typeof fn === "function" &&
Object.prototype.hasOwnProperty.call(this, k)) {
fn.call(context, this[k], k, this);
}
}
};
// map兼容性处理
Array.prototype.map = Array.prototype.map ||
function (fn, context) {
var arr = [];
if (typeof fn === "function") {
for (var k = 0, length = this.length; k < length; k++) {
arr.push(fn.call(context, this[k], k, this));
}
}
return arr;
};
// filter兼容性处理
Array.prototype.filter = Array.prototype.filter ||
function (fn, context) {
var arr = [];
if (typeof fn === "function") {
for (var k = 0, length = this.length; k < length; k++) {
fn.call(context, this[k], k, this) && arr.push(this[k]);
}
}
return arr;
};
// some兼容性处理
Array.prototype.some = Array.prototype.some ||
function (fn, context) {
var passed = false;
if (typeof fn === "function") {
for (var k = 0, length = this.length; k < length; k++) {
if (passed === true) break;
passed = !!fn.call(context, this[k], k, this);
}
}
return passed;
};
// every兼容性处理
Array.prototype.every = Array.prototype.every ||
function (fn, context) {
var passed = true;
if (typeof fn === "function") {
for (var k = 0, length = this.length; k < length; k++) {
if (passed === false) break;
passed = !!fn.call(context, this[k], k, this);
}
}
后面还有 425 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。