Here you can find the source of head()
Array.prototype.head = function() { return this[0]; }
Array.prototype.head = function () { if (this.length == 0) { return null; return this[0];