Nodejs Utililty Methods Array First Item

List of utility methods to do Array First Item

Description

The list of methods to do Array First Item are organized into topic(s).

Method

first()
Array.prototype.first = function () {
    return this[0];
};
first()
Array.prototype.first = function() {
  return this[0];
Array.prototype.last = function() {
  return this[this.length-1];
first()
Array.prototype.first = function() {
  return this[0];
first()
Array.prototype.first = function() {
    if (this.isEmpty()) {
        return null;
    return this[0];
};
first()
Array.prototype.first = function() {
    if (this.length == 0) return null
    return this.slice(0)[0]