Nodejs Array Get Object getItemByIndex( i )

Here you can find the source of getItemByIndex( i )

Method Source Code

Array.prototype.getItemByIndex = function( i ) {
  me = this;/*www.j av  a  2  s.co  m*/
   return me[i];
}

a = [ '11', '22', '33' ];
a.getItemByIndex( 1 );

Related

  1. getIndexBy(name, value)
    angular
        .module('app', [
            'angular.filter',
            'ui.router',
            'ngAnimate',
            'ngMaterial',
            'user',
            'login',
            'register',
    ...
    
  2. getIndexByKey(name)
    Array.prototype.getIndexByKey = function(name) {
      for (var i = 0; i < this.length; i++) {
        if (this[i][name]) {
          return i;
      return -1;
    
  3. getIndexByVal(key,val)
    Array.prototype.getIndexByVal=function(key,val){
        for (var i in this){
            if(this[i].hasOwnProperty(key)){
                if(this[i][key]===val){
                    return i
        return false
    ...
    
  4. getIndexByValue(value)
    Array.prototype.getIndexByValue = function (value) {
        var index = -1;
        for (var i = 0; i < this.length; i++) {
            if (this[i] == value) {
                index = i;
                break;
        return index;
    ...
    
  5. getIndexFromID(id)
    Array.prototype.getIndexFromID = function(id){
      for(var i = 0; i < this.length; i++){
        if(this[i].id == id){ return i; }
    
  6. getItemFromID(id)
    Array.prototype.getItemFromID = function(id){
      for(var i = 0; i < this.length; i++){
        if(this[i].id == id){ return this[i]; }
    
  7. getObjHasKey(key)
    Array.prototype.getObjHasKey=function(key){
        for (var i in this){
            if(this[i].hasOwnProperty(key)){
                return i
        return false
    
  8. getObjectBy(field, withValue)
    Array.prototype.getObjectBy = function(field, withValue)
      for (var i = 0; i < this.length; i++) {
        if(this[i][field] == withValue)
          return this[i];
      return null;
    
  9. getObjectByKey(key, value)
    Array.prototype.getObjectByKey = function(key, value){
      var toReturn = null
      $.each(this, function(i, object){
        if(object[key] == value){
          toReturn = object
          return false
      })
      return toReturn
    ...