Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
step2-2 done!
  • Loading branch information
EliaYazdi committed Aug 2, 2019
commit a6005c445218ab3c62fe4833fefe104c76a935c1
28 changes: 19 additions & 9 deletions Week3/homework/step2-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@

function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) {
const numbers = [];

// Replace this comment and the next line with your code
console.log(startIndex, stopIndex, threeCallback, fiveCallback, numbers);
for (let i = startIndex; i <= stopIndex; i++) {
numbers.push(i);
if (i % 3 === 0) {
threeCallback();
}
if (i % 5 === 0) {
fiveCallback();
}
if (i % 3 === 0 && i % 5 === 0) {
threeCallback(fiveCallback());
}
}
}


function sayThree(number) {
// Replace this comment and the next line with your code
console.log(number);
}
console.log('${number} is divisible by three')

};

function sayFive(number) {
// Replace this comment and the next line with your code
console.log(number);

console.log('${number} is divisible by five');
}

threeFive(10, 15, sayThree, sayFive);

// Do not change or remove anything below this line
module.exports = threeFive;
module.exports = threeFive;