cloneNode

fun cloneNode(subtree: Boolean = definedExternally): Node(source)

The cloneNode() method of the Node interface returns a duplicate of the node on which this method was called. Its parameter controls if the subtree contained in a node is also cloned or not.

MDN Reference