class Node {
constructor(element){
//the element holds the data of a node
this.element = element;
//pointer to the next node which is initialized to null
this.next = null;
}
}
const list = {
head: {
value: 1
next: {
value: 5
next: {
value: 7
next: {
value: 13
next: null
}
}
}
}
}
};
/*each of them has a value and a next that is also a nodelist(or is null)*/