Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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

Open
mmargo10 wants to merge1 commit intobloominstituteoftechnology:master
base:master
Choose a base branch
Loading
frommmargo10:master

Conversation

@mmargo10
Copy link

No description provided.

Copy link

@indifferentghostindifferentghost left a 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]);

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]));

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);
};

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@indifferentghostindifferentghostindifferentghost left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mmargo10@indifferentghost

[8]ページ先頭

©2009-2025 Movatter.jp