Popping element from the top of the stack
function stack_pop ( stack ) { document . write ( " " ) ; for ( var i = 0 ; i < 5 ; i ++ ) { var y = parseInt ( stack [ stack . length - 1 ] ) ; stack . pop ( ) ; document . write ( y + " " ) ; } return stack ; }