Solución
solution.tsTypeScript
function isArmstrong(num: number): boolean {
// Tu solución aquí
const numArray = num.toString().split('')
if (numArray.length === 1) return true
let result = 0
numArray.forEach(el => {
result += Math.pow(Number(el), numArray.length)
})
return result === num;
}
// No modificar: necesario para evaluar el resultado.
export { isArmstrong };0respuestas