Add method to array to get first element - Node.js Array

Node.js examples for Array:First Element

Description

Add method to array to get first element

Demo Code

Array.prototype.first = function() {
    return this[0];
}

Related Tutorials