SOURCE

function g(num) {
  if (num < 10) return num;
  const next = ('' + num).split('').reduce((a, c) => +a + +c);
  return g(next);
}

console.log(g(448));
console 命令行工具 X clear

                    
>
console