Before you mark duplicate note that it isn't.(在标记重复注释之前,请注意不是。)
Others didn't look for the exact same thing as me.(其他人没有寻找和我完全一样的东西。)
What is the most compact possible way to sum up a number in javascript until there is only one digit left.(总结javascript中直到最剩下一位数字的最紧凑的方法是什么。)
For example: You input 5678 then the script adds it together (5+6+7+8) and gets 26, but since its more than 1 digit it adds it again and gets 2+6=8.(例如:您输入5678,然后脚本将其加在一起(5 + 6 + 7 + 8)并得到26,但是由于其大于1的数字,它将再次添加它并得到2 + 6 = 8。)
Is there anyway to do this with a number of any size?(无论如何,有任何大小的数字都可以做到这一点吗?)
And how compact can the script get?(脚本可以得到多紧凑?)
ask by Vincent translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…