Loading homepage
Input: // root: <div><i id="start">one</i><b>two</b><i id="end">three</i></div> getTextBetweenNodes(root, start, end); Output: "onetwo" because the start element’s text is after the start node.
Input: // root child nodes: Text("A"), Text("B"), Text("C") getTextBetweenNodes(root, root.firstChild, root.lastChild); Output: "B"
Implement the exported API in index.js or index.ts. Tests cover the contract and edge cases below.