The TimeRanges.length read-only property returns the number of ranges in the object.
TimeRanges.length
MDN Reference