Topics discussed this week:
• Async vs Sync
• Event Loop (order of execution)
• Promises
-
Read this article on scopes & closures: explaining-javascript-scope-and-closures
-
If you are still not completely clear on promises, here are some additional resources 💍
- Fix Requested Changes (if any) on the Pull Request.
Deadline Thursday
The homework for week 2 will build on the work you did in week 1. You will create a new branch based on the week1 branch.
-
Make sure that you committed all changes in the week 1 version of your homework.
-
Create a new
week2branch:git checkout -b week2
You will continue to work on the files index.js and (possibly) style.css.
- Complete your GitHub app code from the previous week, if needed, to meet the requirements from that week's assignment.
- Replace all asynchronous callbacks (e.g. as used with XMLHttpRequest) by ES6 promises.
- Beautify your app's styling.
- If not yet completed in week 1, make your app responsive (use CSS media queries and Flexbox).
If necessary, review the instructions how to Hand in homework using GitHub pull request.
To test whether your code will be accepted when you submit your homework as a pull request you need to ensure that it does not contain ESLinr errors. Open a terminal window in VSCode and type the following command:
npm test
If any errors or warnings are reported by this command you need to fix them before submitting a pull request.
In addition, check for the following:
- Have you removed all commented out code (should never be present in a PR)?
- Do the variable, function and argument names you created follow the Naming Conventions?
- Is your code well-formatted (see Code Formatting)?
If the answer is 'yes' to the preceding questions you are ready to follow these instructions:
-
Push your
week2branch to GitHub:git push -u origin week2 -
Create a pull request for your
week2branch.
Note:
- Please remove all redundant, commented-out code and console.log's from your files before pushing your homework as finished. There is no need for your mentors to review this stuff.
- Please make sure your code is well-formatted and follows the recommended naming conventions.
Go through the reading material in the README.md to prepare for your next class.