Justin Rigler - #211
Conversation
kiachoi
left a comment
There was a problem hiding this comment.
Overall, you did an awesome job. I know this material can be difficult - just let me know if you need extra understanding! Something I would recommend is for you to review the lecture videos. There is a lot to learn the second time around! Upon saying that, if you get stuck on anything for more than 20 min, HOLLER AT SOMEONE. ❤️
| # Your responses to the short answer questions should be laid out here using Mark Down. | ||
| ### For help with markdown syntax [Go here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) | ||
|
|
||
| 1. .forEach merely iterates through an array while .map actually iterates and takes the elements to make a new array. |
There was a problem hiding this comment.
A clear difference is that forEach doesn't return anything whereas map does! Good answer!
|
|
||
| 2. Boolean, Null, Undefined, Number, String, Symbol and Object. An array is an object but it comes with tons of methods (like .length) that can be used to iterate through it. | ||
|
|
||
| 3. Closures are functions called within themselves that can store the updated variables of their outer scoped function. |
There was a problem hiding this comment.
Your definition of closures is 100% correct! I forgot to give you a link to understand it more in-depth but better late than never right?? 😅
http://javascriptissexy.com/understand-javascript-closures-with-ease/
| // newCounter(); // 2 | ||
| let count = 0; | ||
| function increment() { | ||
| return count++; |
There was a problem hiding this comment.
You should have it so that it returns ++count . When you have count++ it will save the count before it iterates which is something that we don't want!
| const limitFunctionCallCount = (cb, n) => { | ||
| // Should return a function that invokes `cb`. | ||
| // The returned function should only allow `cb` to be invoked `n` times. | ||
|
|
There was a problem hiding this comment.
This method can be done by looking at your previous projects! Take a look at JS-II I believe.
For this portion, you can implement something like a counter and calling a cb from it. If you are still having trouble, just let me know or your group!
No description provided.