Driver code
var s = [ ] ; s . push ( 10 ) ; s . push ( 20 ) ; s . push ( 30 ) ; s . push ( 40 ) ; s . push ( 50 ) ; var arr = [ 20 , 30 ] ; var n = arr . length ; if ( checkArrInStack ( s , arr , n ) ) document . write ( " " ) ; else document . write ( " " ) ;