Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a593368

Browse files
committed
last changes according to jim's feedback
1 parent f673863 commit a593368

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

Week6/MAKEME.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -137,28 +137,6 @@ addSix(10); // returns 16
137137
addSix(21); // returns 27
138138
```
139139

140-
2. You will need to create an HTML document out of the below snippet to run the below code. A hint - the code is syntactically correct but doesn't do what you would expect. Can you see why and fix it?
141-
142-
Don't cheat - but if you get stuck ... http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example
143-
144-
```html
145-
<button id="btn-0">Button 1!</button>
146-
<button id="btn-1">Button 2!</button>
147-
<button id="btn-2">Button 3!</button>
148-
149-
<script type="text/javascript">
150-
151-
let prizes = ['A Unicorn!', 'A Hug!', 'Fresh Laundry!'];
152-
for (let btnNum = 0; btnNum < prizes.length; btnNum++) {
153-
// for each of our buttons, when the user clicks it...
154-
document.getElementById('btn-' + btnNum).onclick = function() {
155-
// tell her what she's won!
156-
alert(prizes[btnNum]);
157-
};
158-
}
159-
</script>
160-
```
161-
162140
__Bonus__: Write a function takes this array `['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']` and returns an array which only has unique values in it (so it removes the duplicate ones). Make it a 'smart' algorithm that could do it for every array (only strings/number). Try to make it as fast as possible!
163141

164142

eventlisterassignment.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)