js any array

JavaScript
let array = [1, 2, 3, 4, 5];

//Is any element even?
array.some(function(x) {
  return x % 2 == 0;
}); // true 
// 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 });
}
Source

Also in JavaScript: