Nodejs Array First Item first()

Here you can find the source of first()

Method Source Code

Array.prototype.first = function() {
    if (this.isEmpty()) {
        return null;
    }//from ww w .java  2s.  c  o m
        
    return this[0];
};

Related

  1. first()
    Array.prototype.first = function(){
        if (this.length > 0)
            return this[0];
        else
            return [];
    
  2. first()
    Array.prototype.first = function () {
        this.current = 0;
        return jQuery.extend(true, [], this[this.current]);
    };
    Array.prototype.last = function () {
        this.current = this.length - 1;
        return jQuery.extend(true, [], this[this.length - 1]);
    };
    Array.prototype.next = function () {
    ...
    
  3. first()
    Array.prototype.first = function () {
        return this[0];
    };
    
  4. first()
    Array.prototype.first = function() {
      return this[0];
    Array.prototype.last = function() {
      return this[this.length-1];
    
  5. first()
    Array.prototype.first = function() {
      return this[0];
    
  6. first()
    Array.prototype.first = function() {
        if (this.length == 0) return null
        return this.slice(0)[0]