Tab.Filegroups has an invisble group "unspecified"

While using the following code to enumerate the filegroups of a tab came to a problem.

function OnClick(clickData)
	var tab = clickData.func.sourcetab;
	var groups = tab.filegroups;
	for (var groupEnum = new Enumerator(groups); !groupEnum.atEnd(); groupEnum.moveNext())

function Log(msg)

It produces the following sample output


As you can see there are three groups (Jpg, mp4, quicktime) in the tab. But there shows a a fourth group ("unspecified") in the logs which does is not visible in the tab. Is this an intentional behaviour or a bug? Couldnt find a clue in the docs.
Right now i have to substract 1 from groups.count to end up at the "right" amount of groups.

The "unspecified" group exists to catch things that don't fall into the others (or which haven't been grouped yet, for files which were just added in some situations). If there's nothing in it then it won't be visible in the file display, but it still exists behind the scenes.

You can use the group's count property to see if it's empty or not. The docs for the property mention this:

Returns the number of items in this group. Note that groups can be empty; empty groups are not displayed in the file display but will still be returned by the Tab.filegroups property.