define lcm function
function lcm_fun ( a , b ) { if ( b == 0 ) return a ; return lcm_fun ( b , a % b ) ; } function digitLCM ( n ) { let lcm = 1 ; while ( n > 0 ) { lcm = ( n % 10 * lcm ) / lcm_fun ( n % 10 , lcm ) ;