Check if a number ends with another number or not | Function to check if B is a suffix of A or not ; Convert numbers leto Strings ; Check if s2 is a suffix of s1 or not ; If result is true , prlet " Yes " ; Given numbers ; Function Call
function checkSuffix ( A , B ) { let s1 = A . toString ( ) ; let s2 = B . toString ( ) ; let result ; result = s1 . endsWith ( s2 ) ; if ( result ) { document . write ( " " ) ; } else { document . write ( " " ) ; } } let A = 12345 , B = 45 ; checkSuffix ( A , B ) ;