Implementation of Stack using Arrays

Run Settings
LanguageJavaScript
Language Version
Run Command
class Node { constructor(value){ this.value = value; this.next = null; } } class Stack { constructor(){ this.array=[] } peek() { return this.array[this.array.length-1]; } push(value){ this.array.push(value); return this; } pop(){ this.array.pop(); return this; } //isEmpty } const myStack = new Stack(); myStack.peek(); myStack.push('google'); myStack.push('udemy'); myStack.push('discord'); myStack.pop(); //Discord //Udemy //google
Editor Settings
Theme
Key bindings
Full width
Lines