Check whether two strings contain same characters in same order |  ; If length of the b = 0 then we return true ; If length of a = 0 that means b is not present in a so we return false ; Driver code
function checkSequence ( a , b ) { if ( b . length == 0 ) return true ; if ( a . length == 0 ) return false ; if ( a [ 0 ] == b [ 0 ] ) return checkSequence ( a . substring ( 1 ) , b . substring ( 1 ) ) ; else return checkSequence ( a . substring ( 1 ) , b ) ; } let s1 = " " , s2 = " " ; if ( checkSequence ( s1 , s2 ) ) document . write ( " " ) ; else document . write ( " " ) ;