Javascript Array defaultIfEmpty(val)

Description

Javascript Array defaultIfEmpty(val)


Array.prototype.defaultIfEmpty = function (val) {
  return this.length == 0 ? [val == null ? null : val] : this;
};



PreviousNext

Related