|
| 1 | +# Homework for the extra JavaScript module Class8 |
| 2 | + |
| 3 | +## What we did in lecture 1: |
| 4 | +Code Kata Race |
| 5 | + |
| 6 | +- Problem 1 https://www.codewars.com/kata/keep-up-the-hoop |
| 7 | +- Problem 2 https://www.codewars.com/kata/find-the-first-non-consecutive-number |
| 8 | +- Problem 3 https://www.codewars.com/kata/negation-of-a-value |
| 9 | + |
| 10 | + |
| 11 | +## Homework week 1: (I EXPECT ALL OF YOU TO AT LEAST ATTEMPT PROBLEMS 1-5): |
| 12 | +- https://www.codewars.com/collections/hyf-homework-1 |
| 13 | +- https://www.codewars.com/collections/hyf-homework-1-bonus-credit |
| 14 | + |
| 15 | +Remember the person with the most kata points gets a prize from Gijs (and you can do exercises on this website without me telling you to - anything kyu 7 or kyu 8 you can try to do - kyu 6 or lower is probably too hard) |
| 16 | + |
| 17 | +- Hint for Q1: split your code into two parts, one part for the case that one of the two strings has an extra letter at the start or the end but is otherwise identical & one part for the case that the strings are the same length but one character is different in one of the strings |
| 18 | +- Also for Q1 this function on strings might be useful https://www.w3schools.com/jsref/jsref_slice_string.asp |
| 19 | +- Also potentially useful |
| 20 | +https://www.w3schools.com/jsref/jsref_charat.asp |
| 21 | +- Hint for Q2: https://www.w3schools.com/jsref/jsref_sort.asp Also there are no sample tests, you need to use submit |
| 22 | + |
| 23 | +## To watch before second lecture: |
| 24 | +(watch in this order) |
| 25 | + |
| 26 | +1. Stacks/Queues https://www.youtube.com/watch?v=wjI1WNcIntg (5 mins) |
| 27 | +2. JS Event Loops https://www.youtube.com/watch?v=8aGhZQkoFbQ (26 mins, watch this one twice or until you understand it) |
| 28 | + |
| 29 | +## The tools we used in the second lecture |
| 30 | +- [metajs](http://int3.github.io/metajs/) |
| 31 | +- [latentflip](http://latentflip.com/loupe/?code=Y29uc3QgcCA9IG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCl7CiAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAgICAgICAgY29uc3QgZGljZVJvbGwgPSBNYXRoLmNlaWwoTWF0aC5yYW5kb20oKSAqIDYpOwogICAgICAgIGNvbnNvbGUubG9nKGRpY2VSb2xsKTsKICAgICAgICBpZihkaWNlUm9sbCA9PT0gNikKICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcigncm9sbGVkIGEgc2l4JykpCiAgICAgICAgZWxzZQogICAgICAgICAgICByZXNvbHZlKGRpY2VSb2xsKQogICAgfSwgNTAwMCk7Cn0pOwoKCnAKICAgIC50aGVuKGZ1bmN0aW9uKHJvbGwpewogICAgICAgIGNvbnNvbGUubG9nKCdkaWNlIHJvbGxlZCBhICcgKyByb2xsKQogICAgfSkKICAgIC5jYXRjaChmdW5jdGlvbihlcnIpewogICAgICAgIAogICAgfSk7!!!PGJ1dHRvbj5DbGljayBtZSE8L2J1dHRvbj4%3D) |
| 32 | + |
| 33 | +## Homework Week 2 |
| 34 | +- https://www.codewars.com/collections/hyf-homework-number-2 |
| 35 | +- If you need to refresh your memory on es6 classes: https://ponyfoo.com/articles/es6-classes-in-depth |
| 36 | +- Also read this article on scopes & closures: https://robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/ |
0 commit comments