const removeIterative = (element) => {
  let currentNode = head
  let previousNode
  if (currentNode.element === element) {
    head = currentNode.next
  } else {
    while (currentNode.element !== element) {
      previousNode = currentNode
      currentNode = currentNode.next
    }

    previousNode.next = currentNode.next
  }
}

module.exports = removeIterative
