Culling polygons which are behind the camera

This question is deeply related to Z-Clipping / Depth-Clipping in a Javascript 3D Engine. I have an issue of where if a polygon is meant to be behind the camera it will still render, covering the screen because its z position is equal to 0.1 (no polygons behind camera issue). Can you replace/recode the function(s) which need to be? Here is the demo replit link: replit.com/js-3d-2.

I tried to see if all of the vertices z position is 0.1 (the result of no verts behind camera) and if so culling the polygon. It didn’t work.