Check if the number formed by the last digits of N numbers is divisible by 10 or not | Function that returns true if the number formed by the last digits of all the elements is divisible by 10 ; Last digit of the last element ; Number formed will be divisible by 10 ; Driver code
function isDivisible ( arr , n ) { let lastDigit = arr [ n - 1 ] % 10 ; if ( lastDigit == 0 ) return true ; return false ; } let arr = [ 12 , 65 , 46 , 37 , 99 ] ; let n = arr . length ; if ( isDivisible ( arr , n ) ) document . write ( " " ) ; else document . write ( " " ) ;