Here you can find the source of head()
Array.prototype.head = function () { if (this.length == 0) { return null; }//from w ww . j a v a2s . co m return this[0]; }
Array.prototype.head = function() { return this[0];