Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
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
8 changes: 4 additions & 4 deletions Week1/MAKEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ Modify the (mostly empty) files in the `Week1/homework` folder for this step.

**1.2** Open the empty `index.html` and add the required HTML to load the `app.js` file. Open `index.html` in the browser and confirm that the `console.log` statement shows the array. (Open the Chrome Developer Tools and inspect the console.)

**1.3** Remove the temporary `console.log` from step 1.1. Make a function (or functions) that generate a `ul` with `li` elements for each book ID in the array using a `for` loop. Make sure that the function names you choose are an accurate reflection of what they do. As a reminder, here are the recommended [Naming Conventions](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/naming_conventions.md).
**1.3** Remove the temporary `console.log` from step 1.1. Make a function (or functions) that generate a `ul` with `li` elements for each book title in the array using a `for` loop. Make sure that the function names you choose are an accurate reflection of what they do. As a reminder, here are the recommended [Naming Conventions](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/naming_conventions.md).

**1.4** Make an object (_not an array!_) containing information for each book. Each property of this object should be another (i.e., nested) object with the book ID you thought up in step 1.1 as a key, and at least the following properties: `title`, `language` and `author`.
**1.4** Make an object (_not an array!_) containing information for each book. Each property of this object should be another (i.e., nested) object with the book title you thought up in step 1.1 as a key, and at least the following properties: `title`, `language` and `author`.

**1.5** Now change the function from step 1.3 that you used to display the book ID's in a list to take the actual information about the book from the object and display that. Make sure you choose the correct HTML elements for each piece of info, for instance, a heading for the title.
**1.5** Now change the function from step 1.3 that you used to display the book title in a list to take the actual information about the book from the object and display that. Make sure you choose the correct HTML elements for each piece of info, for instance, a heading for the title.

**1.6** Beautify your html page with css (use the `style.css` file for that), add sources and alts to each of the images.

**1.7** Find and download book covers for each book and construct a new object which has as keys the book IDs again, and as value the path to the image source (e.g. `{ harry_potter_blabla: './img/harry_potter_blabla.jpg', ... }`).
**1.7** Find and download book covers for each book and construct a new object which has as keys the book titles again, and as value the path to the image source (e.g. `{ harry_potter_blabla: './img/harry_potter_blabla.jpg', ... }`).

**1.8** Loop over these entries (_hint: `Object.keys(objectName)` gives you an array containing the keys_). Then write a function which places an image at the corresponding `li` element. Remember that objects are not ordered, so you cannot guarantee that the first key is the first `li` element. (_Hint: you could give each `li` item an `id` tag by modifying the function you made before._)

Expand Down
6 changes: 5 additions & 1 deletion Week1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@ In week one we will discuss the following topics:

Then, click on the `{ }` button in the top-right corner of the settings screen to access the settings in JSON format.


```json
/// Place your settings in this file to overwrite the default settings
{
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.minimap.enabled": false,
"editor.renderIndentGuides": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"eslint.autoFixOnSave": true,
"files.autoSave": "onFocusChange",
"prettier.printWidth": 100,
"prettier.singleQuote": true,
Expand Down
20 changes: 18 additions & 2 deletions Week1/homework/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
'use strict';

{
const bookTitles = [
const favoriteGames = [
// Replace with your own book titles
'harry_potter_chamber_secrets',
'call_of_the_wild',
'the_turtle',
'snowball_and_the_bunny_adventures',
'chicken_little',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never played any of those games!
Need to look into it. Cool stuff 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;) good luck

];

// Replace with your own code
console.log(bookTitles);
console.log(favoriteGames);
// document.body.onload = addElement;
// function displayGameTitles = () => {

let unorderedList = document.createElement("ul");
for (const gameIndex in favoriteGames) {
const listItem = document.createElement("li");
listItem.textContent = favoriteGames[gameIndex];
unorderedList.appendChild(listItem);
}
// add the newly created element and its content into the DOM
const currentDiv = document.getElementById("gameDiv");
document.body.insertBefore(unorderedList, currentDiv);
}
12 changes: 11 additions & 1 deletion Week1/homework/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
<!-- replace this with your HTML content -->
<!-- replace this with your HTML content -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>FavoriteBooks Excercise</title>
</head>
<body>
<script src="app.js"></script>
<div id = gameDiv></div>
</body>
</html>
22 changes: 11 additions & 11 deletions Week2/MAKEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,43 +44,43 @@ Rewrite the above `doubleOddNumbers` function using `map` and `filter`; don't fo
const monday = [
{
name: 'Write a summary HTML/CSS',
duration: 180
duration: 180,
},
{
name: 'Some web development',
duration: 120
duration: 120,
},
{
name: 'Fix homework for class10',
duration: 20
duration: 20,
},
{
name: 'Talk to a lot of people',
duration: 1.0
}
duration: 200,
},
];

const tuesday = [
{
name: 'Keep writing summary',
duration: 1.0
duration: 240,
},
{
name: 'Some more web development',
duration: 180
duration: 180,
},
{
name: 'Staring out the window',
duration: 10
duration: 10,
},
{
name: 'Talk to a lot of people',
duration: 1.0
duration: 200,
},
{
name: 'Look at application assignments new students',
duration: 40
}
duration: 40,
},
];
```

Expand Down
6 changes: 3 additions & 3 deletions Week3/MAKEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Topics discussed this week:

> Read:

- JavaScript : [Closures](http://conceptf1.blogspot.nl/2012.11/javascript-closures.html)
- JavaScript : [Closures](http://conceptf1.blogspot.com/2013/11/javascript-closures.html)
- Everything you wanted to know about [JavaScript scope](https://toddmotto.com/everything-you-wanted-to-know-about-javascript-scope/)
- JavaScript [Scoping and Hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html)
- 5 JavaScript [“Bad” Parts That Are Fixed In ES6](https://medium.freecodecamp.com/5-javascript-bad-parts-that-are-fixed-in-es6-c7c45d44fd81)
Expand Down Expand Up @@ -74,7 +74,7 @@ function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) {

threeFive(10, 15, sayThree, sayFive);

// Should create an array [10,11,12,12.14,15]
// Should create an array [10,11,12,13,14,15]
// and call sayFive, sayThree, sayThree, sayFive
// please make sure you see why these calls are made before you start coding
```
Expand Down Expand Up @@ -167,7 +167,7 @@ To run the unit test for the week 3 homework, open a terminal window in the `Jav
npm run test-week3
```

In case of errors, try and fix them. When done, run the tests again: `npm run test3`
In case of errors, try and fix them. When done, run the tests again.

Repeat the previous step until all tests pass.

Expand Down