Skip to content
Prev Previous commit
Next Next commit
step 2-2
  • Loading branch information
EliaYazdi committed Aug 15, 2019
commit 666dd0ade308ff5faade88304330cb77f897595f
7 changes: 2 additions & 5 deletions Week3/homework/step2-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) {
for (let i = startIndex; i <= stopIndex; i++) {
numbers.push(i);
if (i % 3 === 0) {
threeCallback();
threeCallback(i);
}
if (i % 5 === 0) {
fiveCallback();
}
if (i % 3 === 0 && i % 5 === 0) {
threeCallback(fiveCallback());
fiveCallback(i);
}
}
}
Expand Down