UiPath interview question

Some document traversal using javascript, technical discussion around implementation