Skip to content
Open
Show file tree
Hide file tree
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
finished 2.1 and 2.1
  • Loading branch information
jshortz committed Jul 13, 2019
commit cae0024a6415d0cc5beed40f3549c3b6a6536a0b
4 changes: 1 addition & 3 deletions Week3/homework/step2-1.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

function foo(func) {
// What to do here?
// Replace this comment and the next line with your code
console.log(func);
func();
}

function bar() {
Expand Down
19 changes: 15 additions & 4 deletions Week3/homework/step2-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@

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

// Replace this comment and the next line with your code
let numbersStart = startIndex;
let numbersEnd = stopIndex;
while (numbersStart <= numbersEnd) {
numbers.push(numbersStart);
numbersStart++;
}
console.log(numbers);
for (let i = 0; i < numbers.length; i++) {
let number = numbers[i];
if (number % 3 === 0) {
threeCallback = sayThree(number);
} if (number % 5 === 0) {
fiveCallback = sayFive(number);
}
}
console.log(startIndex, stopIndex, threeCallback, fiveCallback, numbers);
Comment thread
jshortz marked this conversation as resolved.
Outdated
}

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

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

Expand Down