✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Fill in the blank to make the code calculate the sum of the cubes of the numbers from 1 to 3 (i.e., 1³ + 2³ + 3³).
function sumTo(n, f = x => x) {
return n ? f(n) + sumTo(n-1, f) : 0;
}
const sumOfCubes = sumTo(3, _______________);
// sumOfCubes should be 36 (1 + 8 + 27)