The WebGLRenderingContext.depthFunc() method of the WebGL API specifies a function that compares incoming pixel depth to the current depth buffer value.
WebGLRenderingContext.depthFunc()
external void depthFunc(GLenum func);