equals(polygon)
    {
        if (!polygon || this.points.length !== polygon.points.length)
        {
            return false;
        }

        for (let i = 0; i < this.points.length; ++i)
        {
            if (this.points[i] !== polygon.points[i])
            {
                return false;
            }
        }

        return true;
    }
/**
     * Checks if the passed polygon is equal to this one (has the same points).
     *
     * @param {Polygon} polygon - The polygon to check for equality.
     * @return {boolean} Whether polygons are equal.
     */
Checks if the passed polygon is equal to this one (has the same points).
@param {Polygon} polygon - The polygon to check for equality.
@return {boolean} Whether polygons are equal.
Checks if the passed polygon is equal to this one ( has the same points ) . @param { Polygon } polygon - The polygon to check for equality . @return { boolean } Whether polygons are equal .
equals(polygon)
    {
        if (!polygon || this.points.length !== polygon.points.length)
        {
            return false;
        }
        for (let i = 0; i < this.points.length; ++i)
        {
            if (this.points[i] !== polygon.points[i])
            {
                return false;
            }
        }
        return true;
    }
equals ( polygon ) { if ( ! polygon || this . points . length !== polygon . points . length ) { return false ; } for ( let i = 0 ; i < this . points . length ; ++ i ) { if ( this . points [ i ] !== polygon . points [ i ] ) { return false ; } } return true ; }
Checks if the passed polygon is equal to this one (has the same points).
Checks if the passed polygon is equal to this one ( has the same points ) .