setEnd

fun setEnd(node: Node, offset: Int)(source)

The Range.setEnd() method sets the end position of a Range to be located at the given offset into the specified node.

MDN Reference