code: function isNestedRingClosed(simplePolygon) {
    // check if first and last vertex are the same
    const p0 = simplePolygon[0];
    const p1 = simplePolygon[simplePolygon.length - 1];
  
    return p0[0] === p1[0] && p0[1] === p1[1] && p0[2] === p1[2];
  }
docs: Check if a simple polygon is a closed ring
  @param {Array} simplePolygon - array of points
  @return {Boolean} - true if the simple polygon is a closed ring