v1.1.0.Beta

This commit is contained in:
maplemei
2019-11-23 20:10:47 +08:00
parent b14cbaa913
commit 57a0ab9f15
22 changed files with 285 additions and 146 deletions

View File

@@ -79,7 +79,7 @@ if (!Array.prototype.find) {
return callback && (this.filter(callback) || [])[0];
};
}
//拓展Array findIndex方法
if (!Array.prototype.findIndex) {
Array.prototype.findIndex = function(predicate) {
@@ -96,4 +96,13 @@ if (!Array.prototype.findIndex) {
}
return -1;
};
}
//拓展Object values方法
if (!Object.values) {
Object.prototype.values = function(obj) {
return Object.keys(obj).map(function(e) {
return obj[e];
});
};
}