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