export class Stack < T > { private store : T [ ] = [ ] ; push ( val ) { this . store . push ( val ) ; } pop ( ) { return this . store . pop ( ) ; } peek ( ) { return this . store [ this . store . length - 1 ] ; } clear ( ) { this . store = [ ] ; } get length ( ) : number { return this . store . length ; } }