/* load shader source code. */
gl.shaderSource(shader, shaderCode);
/* compile shader source code. */
gl.compileShader(shader);
const message = gl.getShaderInfoLog(shader);
if (message.length > 0) {
/* message may be an error or a warning */
throw message;
}WebGLRenderingContext: getShaderInfoLog() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.