collapse

fun collapse(toStart: Boolean = definedExternally)(source)

The collapse() method of the Range interface collapses the Range to one of its boundary points.

MDN Reference