function createProgram(
        gl, shaders, opt_attribs, opt_locations, opt_errorCallback) {
      const errFn = opt_errorCallback || error;
      const program = gl.createProgram();
      shaders.forEach(function(shader) {
        gl.attachShader(program, shader);
      });
      if (opt_attribs) {
        opt_attribs.forEach(function(attrib, ndx) {
          gl.bindAttribLocation(
              program,
              opt_locations ? opt_locations[ndx] : ndx,
              attrib);
        });
      }
      gl.linkProgram(program);
  
      // Check the link status
      const linked = gl.getProgramParameter(program, gl.LINK_STATUS);
      if (!linked) {
          // something went wrong with the link
          const lastError = gl.getProgramInfoLog(program);
          errFn('Error in program linking:' + lastError);
  
          gl.deleteProgram(program);
          return null;
      }
      return program;
    }
Loads a shader from a script tag.
@param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
@param {string} scriptId The id of the script tag.
@param {number} opt_shaderType The type of shader. If not passed in it will
    be derived from the type of the script tag.
@param {module:webgl-utils.ErrorCallback} opt_errorCallback callback for errors.
@return {WebGLShader} The created shader.