/**
 * A generic Stack
 */ export class Stack < T > { private stack : T [ ] = [ ] ; param e push ( e ) { this . stack . push ( e ) ; return e ; } /**
     * Pop element off the stack
     */ pop ( ) { return this . stack . pop ( ) ; } returns top ( ) { return this . stack . length ? this . stack [ this . stack . length - 1 ] : undefined ; } returns depth ( ) { return this . stack . length ; } }