Find if a number is divisible by every number in a list | Function which check is a number divided with every element in list or not ; driver program
function findNoIsDivisibleOrNot ( a , n , l ) { for ( let i = 0 ; i < l ; i ++ ) { if ( a [ i ] % n != 0 ) return false ; } return true ; } let a = [ 14 , 12 , 4 , 18 ] ; let n = 2 ; let l = a . length ; if ( findNoIsDivisibleOrNot ( a , n , l ) ) document . write ( " " ) ; else document . write ( " " ) ;