src/gl/gl-attribute.js
/**
   * Perform some operation on each set of values for some attribute
   *
   * @chainable
   * @param  {Number}   attributeIndex Index of the attribute to select
   * @param  {Function} callback       Callback
   *
   * @return {this} Returns `this`
   */
Perform some operation on each set of values for some attribute
@chainable
@param  {Number}   attributeIndex Index of the attribute to select
@param  {Function} callback       Callback

@return {this} Returns `this`
Perform some operation on each set of values for some attribute @chainable @param { Number } attributeIndex Index of the attribute to select @param { Function } callback Callback @return { this } Returns ` this `
eachAttribute(attributeIndex, callback) {
    var offset = 0, size, i;
    if(attributeIndex >= 0 && attributeIndex < this.attributes.length) {
      for(i = 0; i < attributeIndex; i++) {
        offset += this.attributes[i].size;
      }
      size = this.attributes[attributeIndex].size;
      for(i = offset; i < this.values.length; i += this.width) {
        callback(this.values.subarray(i, i + size));
      }
    }
    return this;
  }
eachAttribute ( attributeIndex , callback ) { var offset = 0 , size , i ; if ( attributeIndex >= 0 && attributeIndex < this . attributes . length ) { for ( i = 0 ; i < attributeIndex ; i ++ ) { offset += this . attributes [ i ] . size ; } size = this . attributes [ attributeIndex ] . size ; for ( i = offset ; i < this . values . length ; i += this . width ) { callback ( this . values . subarray ( i , i + size ) ) ; } } return this ; }
Perform some operation on each set of values for some attribute
 @chainable
 @param  {Number}   attributeIndex Index of the attribute to select
 @param  {Function} callback       Callback
Perform some operation on each set of values for some attribute @chainable @param { Number } attributeIndex Index of the attribute to select @param { Function } callback Callback