📅  最后修改于: 2022-03-11 15:01:43.953000             🧑  作者: Mango
const sequenceSum = (begin, end, step) => {
let sum = 0
for (let i = begin; i <= end; i += step) sum += i;
return sum
};
console.log(sequenceSum(2, 6, 2))