rangeCount

external val rangeCount: Int(source)

The Selection.rangeCount read-only property returns the number of ranges in the selection.

MDN Reference