Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a593368

Browse filesBrowse files
committed
last changes according to jim's feedback
1 parent f673863 commit a593368
Copy full SHA for a593368

File tree

Expand file treeCollapse file tree

2 files changed

+0
-27
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+0
-27
lines changed
Open diff view settings
Collapse file

‎Week6/MAKEME.md‎

Copy file name to clipboardExpand all lines: Week6/MAKEME.md
-22Lines changed: 0 additions & 22 deletions
  • Display the source diff
  • Display the rich diff
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

Collapse file

‎eventlisterassignment.md‎

Copy file name to clipboardExpand all lines: eventlisterassignment.md
-5Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.