code: function nodePosition(node) {
    let name = node.nodeName
    let position = 1
    while ((node = node.previousSibling)) {
      if (node.nodeName === name) position += 1
    }
    return position
  }
docs: Get the ordinal position of this node among its siblings of the same name.