duplicated solutions in loops to match themes

This commit is contained in:
2026-01-03 13:44:33 +10:00
parent b2bc0651ec
commit 6bbcec3411
3 changed files with 27 additions and 0 deletions

View File

@@ -1,3 +1,11 @@
function sum() {
return arguments.reduce((total, num) => total + num, 0);
}
function sum() {
let total = 0;
for (let i = 0; i < arguments.length; i++) {
total += arguments[i];
}
return total;
}