md`# Javascript Stack implementation using LinkedList and LinkedListNode`
LinkedListNode=functionLinkedListNode(value){
this.value=value;
this.next=null;
}
LinkedList=functionLinkedList(){
this.head=null;
this.tail=null;
this.length=0;
}
LinkedList.prototype.push=functionpush(pushed){
varhead=this.head;
this.head=pushed;
this.head.next=head;
this.length+=1;
return{stack:this,pushed};
}
LinkedList.prototype.pop=functionpop(){
if(this.length===0)return;
varpopped=this.head;
this.head=popped.next;
this.length-=1;
popped.next=null;
return{stack:this,popped};
}
stack=newLinkedList
stack.push(newLinkedListNode(1))
stack.push(newLinkedListNode(2))
stack.pop()
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.