JavaScript Armstrong Number Validator (ES6) I have the following function which takes in an input and validates if that input is an Armstrong number or not:


  An Armstrong Number is a number such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3 ** 3 + 7 ** 3 + 1 ** 3 = 371.


Here's a link to the program on codepen.

const isArmstrong = input =&gt; {
  const expandedInputExpression = `
    ${input[0]} ** 3 + ${input[1]} ** 3 +
    ${input[2]} ** 3`;

  const expandedInputValue = Array.from(input)
    .map(digit =&gt; digit)
    .reduce((total, currentDigit) =&gt; total + currentDigit ** 3, 0);


  if (expandedInputValue === parseInt(input)) {
    console.log(`${input} is an Armstrong number since ${expandedInputExpression} = ${input}`);
    return true;
  } else {
    console.log(`
    ${input} is not an Armstrong number because ${expandedInputExpression}( ${expandedInputValue}) is not equal to ${input}`);
    return false;
  }
};


Is there any way to refactor and simplify the function?
Being called isArmstrong, it should just return a boolean value, and not have side effects of setting any sort of DOM. That can be done in a separate function by the caller. 
expandedInputValue can probably have a better name. Maybe digitTotal or digitCubeTotal. But the current name isn't helpful.
I think this is a no-op: .map(digit =&gt; digit)