code: function(indexOrItem) {
            var list = this.$list;
            if( angular.isNumber(indexOrItem) && indexOrItem >= 0 && list.length >= indexOrItem ) {
              return list[indexOrItem];
            }
            else if( angular.isObject(indexOrItem) ) {
              // it must be an item in this array; it's not sufficient for it just to have
              // a $id or even a $id that is in the array, it must be an actual record
              // the fastest way to determine this is to use $getRecord (to avoid iterating all recs)
              // and compare the two
              var key = this.$$getKey(indexOrItem);
              var rec = this.$getRecord(key);
              return rec === indexOrItem? rec : null;
            }
            return null;
          }
docs: Resolves a variable which may contain an integer or an item that exists in this array.
  Returns the item or null if it does not exist.
  
  @param indexOrItem
  @returns {*}
  @private