Added all and any to arrays
Removed notes
This commit is contained in:
parent
ba85af796e
commit
e3ad9348b5
@ -1,2 +0,0 @@
|
||||
npm install --save-dev webpack webpack-cli
|
||||
npm run build
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "LiteRyzJS",
|
||||
"version": "0.1.0.301",
|
||||
"version": "0.1.0.357",
|
||||
"devDependencies": {
|
||||
"css-loader": "^7.1.2",
|
||||
"sass": "^1.77.8",
|
||||
|
@ -36,8 +36,40 @@ Array.prototype.addRange = function (array) {
|
||||
return this;
|
||||
};
|
||||
|
||||
Array.prototype.all = function (propName, value) {
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
if (propName == null) {
|
||||
if (this[i] != value){
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (typeof(this[i][propName]) != "undefined") {
|
||||
if (this[i][propName] != value){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
Array.prototype.any = function (propName, value) {
|
||||
return (this.count(propName, value) > 0);
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
if (propName == null) {
|
||||
if (this[i] == value){
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (typeof(this[i][propName]) != "undefined") {
|
||||
if (this[i][propName] == value){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Array.prototype.copy = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user