JavaScript - Easy Approach while loop
\n/**\n * @param {string} s\n * @param {number} k\n * @return {string}\n */\nconst digitSum = (s, k) => {\n    while (s.length > k) {\n        const getSum = ar
```\n/**\n * @param {string} s\n * @param {number} k\n * @return {string}\n */\nconst digitSum = (s, k) => {\n    while (s.length > k) {\n        const getSum = arr => arr.reduce((a, n) => parseInt(a) + parseInt(n), 0).toString();\n        const parts = s.match(new RegExp(`.{1,${k}}`, `g`));\n        s = parts.map(p => getSum(p.split(``))).join(``);\n    }\n    \n    return s;\n}\n```
['JavaScript']