This is a little esoteric of a thing, I just needed to do it myself one time and found it confusing so I thought I'd do a whole video on it.
The thing is, not everything is a <path> in SVG. <path> is fantastic because it can be anything. But the syntax for it is just a bit more complex than any of the other shapes. So (maybe for that reason?) Illustrator always outputs the shapes in SVG with the most closely appropriate element. Rectangles are <rect>, other shapes made up of only straight lines are a <polygon>, or if it's an open shape a <polyline>, etc.
That would be fine, except the DOM methods for those shapes vary. A path element has a method called getTotalLength() which lets you know how long the path is. That's pretty cool and sometimes useful, but you can't only do it on a <path>, no other element.
If you do this a lot, there is a tool called Poly2Path that works, and doesn't require that superfluous point.