The WebGLRenderingContext.depthMask() method of the WebGL API sets whether writing into the depth buffer is enabled or disabled.
WebGLRenderingContext.depthMask()
external void depthMask(GLboolean flag);