Function to check if a number is Armstrong or not
function isArmstrong ( x , n ) { let sum1 = 0 ; let temp = x ; while ( temp > 0 ) { let digit = temp % 10 ; sum1 += Math . pow ( digit , n ) ; temp = parseInt ( temp / 10 , 10 ) ; } return ( sum1 == x ) ; }