This may only be dealing with the VAO built-in vs extension:
WebGl1:
var ext = gl.getExtension("OES_vertex_array_object");
if (!ext) {
// tell user they don't have the required extension or work around it
} else {
var someVAO = ext.createVertexArrayOES();
}
WebGl2:
var someVAO = gl.createVertexArray();
This may only be dealing with the VAO built-in vs extension:
WebGl1: var ext = gl.getExtension("OES_vertex_array_object"); if (!ext) { // tell user they don't have the required extension or work around it } else { var someVAO = ext.createVertexArrayOES(); } WebGl2: var someVAO = gl.createVertexArray();
https://webgl2fundamentals.org/webgl/lessons/webgl1-to-webgl2.html