text: function getSumOfDigits(n) {
    let num = n.toString().split('');
    let sum;
    for (;;) {
      sum = 0;
      for (let j = 0; j < num.length; j++) {
        sum += parseInt(num[j], 10);
      }
      num = sum.toString();
      if (sum.toString().length <= 1) break;
    }
    return parseInt(num, 10);
  }
  
  module.exports = getSumOfDigits;
  