main function
let s1 = [ ] ; let s2 = [ ] ; s1 . push ( 34 ) ; s1 . push ( 3 ) ; s1 . push ( 31 ) ; s2 . push ( 1 ) ; s2 . push ( 12 ) ; s2 . push ( 23 ) ; sortedMerge ( s1 , s2 ) ; document . write ( " " + " " ) ; while ( tmpStack . length != 0 ) { document . write ( tmpStack [ tmpStack . length - 1 ] + " " ) ; tmpStack . pop ( ) ; }