- Notifications
You must be signed in to change notification settings - Fork269
JavaScript I without stretch questions#298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
indifferentghost left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great
I am so excited to finally get a pull request from you! The syntax, whitespace and indentation is awesome! Most of the answers are superb.
Requested Improvements
The tests in this are key! There were a couple of problems where you were so close, but it wasn't quite there. While I know it's tempting to just get through the problems I'd like to see more originality through your work.
Rating: {1-3}
2
| // Return all of the values of the object's own properties. | ||
| // Ignore functions | ||
| // http://underscorejs.org/#values | ||
| returnObject.values(obj).map(key=>obj[key]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Object.values(obj); is sufficient the code you currently have actually breaks.
| constmapObject=(obj,cb)=>{ | ||
| // Like map for arrays, but for objects. Transform the value of each property in turn. | ||
| // http://underscorejs.org/#mapObject | ||
| returnObject.values(obj).map(key=>cb(obj[key])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There's a few things wrong with this.
I assume you wanted to useObject.keys(obj) if you wanted to access the values, but this should also be building a new object with the same keys, and values that are passed into the callback function (cb). At the moment you're returning an array ofNaN objects (because of the particular callback function).
| if(callCount===n)returnnull; | ||
| callCount++; | ||
| returncb(...args); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is exactly the solution code from the solution branch... In the future I'd like to see where you got with your own code.
No description provided.