JavaScript:实现返回 n^pow 的幂位和算法
/*
*
* 2¹⁵ = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
*
* What is the sum of the digits of the number 2¹⁰⁰⁰ ?
*/
/**
* Returns the power digit sum of n^pow.
*
* @param {number} [n=2]
* @param {number} [pow=1000]
* @returns {number}
*/
const powerDigitSum = function (n = 2