function replaceNode(newNode, oldNode) {
  const parent = oldNode.parentNode;
  if (parent) {
    parent.replaceChild(newNode, oldNode);
  }
}
/**
 * @param {Node} newNode Node to replace old node
 * @param {Node} oldNode The node to be replaced
 */
@param {Node} newNode Node to replace old node
@param {Node} oldNode The node to be replaced
@param { Node } newNode Node to replace old node @param { Node } oldNode The node to be replaced
function replaceNode(newNode, oldNode) {
  const parent = oldNode.parentNode;
  if (parent) {
    parent.replaceChild(newNode, oldNode);
  }
}
function replaceNode ( newNode , oldNode ) { const parent = oldNode . parentNode ; if ( parent ) { parent . replaceChild ( newNode , oldNode ) ; } }
@param {Node} newNode Node to replace old node
 @param {Node} oldNode The node to be replaced
@param { Node } newNode Node to replace old node @param { Node } oldNode The node to be replaced