Stack
Use case Computer use stack internally called the call stack.
The example of function call
Actions Push: Add a new item to the top Pop: Remove the topmost item and read it function Stack(){ let items = []; this.push = function(item){ items.push(item); } this.pop = function(){ return items.pop(); } this.peek = function(){ return items[items.length-1]; } this.isEmpty = function(){ return items.length ==0; } this.clear = function(){ items = []; } this.