0
Q:

js any array

 
// There's no isEmpty or any method. 
// You can define your own .isEmpty() or .any()

Array.prototype.isEmpty = function() {
    return this.length === 0;
}

Array.prototype.any = function(func) {
   return this.some(func || function(x) { return x });
}
0

New to Communities?

Join the community