Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
556faa9
Update index.js
ebruispir Jul 9, 2019
7b766b7
Update app.js
ebruispir Jul 13, 2019
1be02fb
Update style.css
ebruispir Jul 13, 2019
85c7757
Add files via upload
ebruispir Jul 13, 2019
844fa46
Update index.html
ebruispir Jul 13, 2019
23e06b3
Update app.js
ebruispir Jul 13, 2019
c52e5c2
Update app.js
ebruispir Jul 13, 2019
00f5b80
Update app.js
ebruispir Jul 13, 2019
294b459
Update index.html
ebruispir Jul 13, 2019
b953e01
Update style.css
ebruispir Jul 13, 2019
6cf5094
Update index.js
ebruispir Jul 23, 2019
8b8f5e1
Update app.js
ebruispir Jul 23, 2019
6fc1678
Update index.html
ebruispir Jul 23, 2019
684a5f6
Update style.css
ebruispir Jul 23, 2019
251e403
Delete Metamorphosis.jpg
ebruispir Jul 23, 2019
d026a6a
Delete a_clockwork_orange.jpg
ebruispir Jul 23, 2019
bbc2474
Delete animalfarm.jpg
ebruispir Jul 23, 2019
8de51a1
Delete crime_and_punishment.jpg
ebruispir Jul 23, 2019
db77087
Delete les_miserables.jpg
ebruispir Jul 23, 2019
6acf670
Delete madonna_in_a_fur_coat.jpg
ebruispir Jul 23, 2019
f9f5144
Delete notes_from_underground.jpg
ebruispir Jul 23, 2019
4a9b542
Delete our_grand_despair.jpg
ebruispir Jul 23, 2019
4e74650
Delete the_call_of_the_wild.jpg
ebruispir Jul 23, 2019
08e6bc4
Delete the_nightingale.jpg
ebruispir Jul 23, 2019
ceaa68d
Create exercise.js
ebruispir Jul 25, 2019
d56ffac
Update step2-1.js
ebruispir Jul 26, 2019
d0a12d5
Update step2-2.js
ebruispir Jul 29, 2019
7c4a422
Update step2-1.js
ebruispir Jul 29, 2019
694be96
Update step2-3.js
ebruispir Jul 29, 2019
6a23430
Update step2-4.js
ebruispir Jul 29, 2019
987c98d
Update step2-5.js
ebruispir Jul 29, 2019
7c4b0aa
Update step2-6.js
ebruispir Jul 29, 2019
b86951a
Update step3-bonus.js
ebruispir Jul 29, 2019
05701be
Update step3.js
ebruispir Jul 29, 2019
4f9c157
Update exercise.js
ebruispir Aug 1, 2019
7c45462
Update step2-7.js
ebruispir Aug 1, 2019
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
2 changes: 1 addition & 1 deletion Week1/homework/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- replace this with your HTML content -->
<!-- replace this with your HTML content -->
2 changes: 1 addition & 1 deletion Week1/homework/style.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* add your styling here */
/* add your styling here */
33 changes: 33 additions & 0 deletions Week3/homework/exercise.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//- Create a class called `Form`
//- Add a `null` variable (eg: formElement)
//- Create a methods `createButton` and create an HTML button element in it

class Form {
constructor(formElement) {
this.formElement = null;
const newForm = document.createElement('form');
document.getElementsByTagName('div')[0].appendChild(newForm);
this.formElement = newForm;
}

createButton() {
const newButton = document.createElement('button');
this.formElement.appendChild(newButton);
newButton.innerHTML = ' Button ';
}

createInput() {
const newInput = document.createElement('input');
this.formElement.appendChild(newInput);
}
createCheckBox() {
const newCheckBox = document.createElement('checkbox');
this.formElement.appendChild(newCheckBox);
}
}
const form1 = new Form('formId');
form1.createButton();
form1.createInput();
form1.createCheckBox();

console.log(form1);
7 changes: 1 addition & 6 deletions Week3/homework/step2-1.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
'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() {
console.log('Hello, I am bar!');
}

foo(bar);

// Do not change or remove anything below this line
module.exports = foo;
21 changes: 16 additions & 5 deletions Week3/homework/step2-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@

function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) {
const numbers = [];
for (let i = startIndex; i <= stopIndex; i++) {
numbers.push(i);
}
numbers.forEach(number => {
if (number % 3 === 0) {
threeCallback(number);
} else if (number % 5 === 0) {
fiveCallback(number);
} else if (number % 15 === 0) {
threeCallback(number);
fiveCallback(number);
}
});

// Replace this comment and the next line with your code
console.log(startIndex, stopIndex, threeCallback, fiveCallback, numbers);
}

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

function sayFive(number) {
// Replace this comment and the next line with your code
console.log(number);
console.log(number + ': divisible by 5');
}

threeFive(10, 15, sayThree, sayFive);

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

38 changes: 35 additions & 3 deletions Week3/homework/step2-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
function repeatStringNumTimesWithFor(str, num) {
// eslint-disable-next-line prefer-const
let result = '';

for (; num > 0; num--) {
result += str;
}
// Replace this comment and the next line with your code
console.log(str, num, result);

Expand All @@ -17,21 +19,51 @@ console.log('for', repeatStringNumTimesWithFor('abc', 3));
function repeatStringNumTimesWithWhile(str, num) {
// eslint-disable-next-line prefer-const
let result = '';
while (num > 0) {
result += str;
num--;
}
console.log(str, num, result);

return result;
}

console.log('while', repeatStringNumTimesWithWhile('abc', 3));

// Use a 'do...while' loop
function repeatStringNumTimesWithDoWhile(str, num) {
// eslint-disable-next-line prefer-const
let result = '';
do {
result += str;
num--;
} while (num > 0);

// Replace this comment and the next line with your code
console.log(str, num, result);

return result;
}

console.log('do-while', repeatStringNumTimesWithDoWhile('abc', 3));

// Do not change or remove anything below this line
module.exports = {
repeatStringNumTimesWithFor,
repeatStringNumTimesWithWhile,
repeatStringNumTimesWithDoWhile,
};

console.log('while', repeatStringNumTimesWithWhile('abc', 3));

// Use a 'do...while' loop
function repeatStringNumTimesWithDoWhile(str, num) {
// eslint-disable-next-line prefer-const
let result = '';

// Replace this comment and the next line with your code
do {
result += str;
num--;
} while (num > 0);
console.log(str, num, result);

return result;
Expand Down
4 changes: 3 additions & 1 deletion Week3/homework/step2-4.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

function Dog() {
// add your code here
this.name = 'Efe';
this.color = 'white';
this.numLegs = 4;
}

const hound = new Dog();
Expand Down
7 changes: 5 additions & 2 deletions Week3/homework/step2-5.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
function multiplyAll(arr) {
// eslint-disable-next-line
let product = 1;

// Replace this comment and the next line with your code
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < arr[i].length; j++) {
product *= arr[i][j];
}
}
console.log(arr, product);

return product;
Expand Down
5 changes: 3 additions & 2 deletions Week3/homework/step2-6.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const arr2d = [[1, 2], [3, 4], [5, 6]];
const arr3d = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];

function flattenArray2d(arr) {
// Replace this comment and the next line with your code
return arr.flat();
console.log(arr);
}

function flattenArray3d(arr) {
// Replace this comment and the next line with your code
return arr.flat(2);
console.log(arr);
}

Expand All @@ -21,3 +21,4 @@ module.exports = {
flattenArray2d,
flattenArray3d,
};

8 changes: 6 additions & 2 deletions Week3/homework/step2-7.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ function f2(val) {
f2(y);

console.log(y);

// Add your explanation as a comment here
/*
Constants are block-scoped, much like variables defined using the let statement.
The value of a constant can't be changed through reassignment, and it can't be redeclared.
The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned.
For instance, in the case where the content is an object, this means the object's contents (e.g., its properties) can be altered.
*/
2 changes: 1 addition & 1 deletion Week3/homework/step3-bonus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const values = ['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c'];

function makeUnique(arr) {
// Replace this comment and the next line with your code
return [...new Set(arr)];
console.log(arr);
}

Expand Down
4 changes: 3 additions & 1 deletion Week3/homework/step3.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

function createBase(base) {
// Replace this comment and the next line with your code
return function(item) {
return base + item;
};
console.log(base);
}

Expand Down