List of utility methods to do Array First or Null
firstOrNull()Array.prototype.firstOrNull = function () { if (this.length > 0) { return this[0]; return null; | |
firstOrNull(predicate)Array.prototype.firstOrNull = function(predicate){ var tmp = this.filter( (function(){ var first = true; return function(item){ if(!first) return false; if(predicate(item)){ first = false; return true; ... |