function createBufferFromArray(gl, array, arrayName) {
  var type = arrayName === "indices" ? ELEMENT_ARRAY_BUFFER : ARRAY_BUFFER;
  var typedArray = makeTypedArray(array, arrayName);
  return createBufferFromTypedArray(gl, typedArray, type);
}
Creates a buffer from an array, typed array, or array spec

Given something like this

    [1, 2, 3],

or

    new Uint16Array([1,2,3]);

or

    {
       data: [1, 2, 3],
       type: Uint8Array,
    }

returns a WebGLBuffer that contains the given data.

@param {WebGLRenderingContext} gl A WebGLRenderingContext.
@param {module:twgl.ArraySpec} array an array, typed array, or array spec.
@param {string} arrayName name of array. Used to guess the type if type can not be derived otherwise.
@return {WebGLBuffer} a WebGLBuffer containing the data in array.
@memberOf module:twgl/attributes