class Node {
constructor(element, next = undefined) {
this.element = element;
this.next = next;
}
}
class LinkedList {
constructor() {
this.head = null;
this.length = 0;
}
push(element) {
const node = new Node(element);
if (this.head == null) {
this.head = node;
} else {
current = this.head;
while(current.next != null) {
current = current.next
}
current.next = element;
}
this.length++;
}
insert(element, position) {
const node = new Node(element);
if (this.head == null) {
this.head = node;
} else {
}
}
getElementAt() {
}
remove() {
}
indexOf() {
}
removeAt() {
}
isEmpty() {
return this.length === 0? true : false;
}
}