Thank you! I like those tiny little programming "snacks" :)
shortest (recursion) solution I could find:
const dr = r => r < 10 ? r : dr([...r+''].reduce((b,c) => +b+(+c)));
dr(129); // 3
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.