Nodejs Array Get Last getLastIndexByKey(name)

Here you can find the source of getLastIndexByKey(name)

Method Source Code

Array.prototype.getLastIndexByKey = function(name) {
  var index = -1;

  for (var i = 0; i < this.length; i++) {
    if (this[i][name]) {
      index = i;// w  w w.j  a va2 s  . c  om
    }
  }

  return index;
}

Related

  1. getLastElement()
    Array.prototype.getLastElement = function() {
      return this[this.length - 1];
    };
    
  2. getLastItem()
    Array.prototype.getLastItem = function(){
      return this[this.length - 1];
    Array.prototype.equals = function (targetArray) {
        if (!targetArray)
            return false;
        if (this.length != targetArray.length)
            return false;
        for (var i = 0, l=this.length; i < l; i++) {
    ...