Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Add demo for Array.prototypes Fixes #417 and #416#439

Merged
schalkneethling merged 11 commits into
mdn:masterfrom
maddhruv:master
Jan 22, 2018
Merged

Add demo for Array.prototypes Fixes #417 and #416#439
schalkneethling merged 11 commits into
mdn:masterfrom
maddhruv:master

Conversation

@maddhruv

Copy link
Copy Markdown
Contributor

No description provided.

@maddhruv maddhruv changed the title Add demo for Array.some() Fixes #417 Add demo for Array.prototypes Fixes #417 and #416 Jan 21, 2018

@schalkneethling schalkneethling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of items that needs attention in Array.some(), but this is looking good. Thanks @maddhruv


var even = function(element, index, array) {
// checks whether any element is even
return element % 2 == 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use === here.

<pre>
<code id='static-js'>var array = [1, 2, 3, 4, 5];

var even = function(element, index, array) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not using index nor array inside the function so, no need to declare them as parameters.

<code id='static-js'>var array = [1, 2, 3, 4, 5];

var even = function(element, index, array) {
// checks whether any element is even

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// checks whether an element is even

@schalkneethling

schalkneethling commented Jan 22, 2018

Copy link
Copy Markdown

Thanks @maddhruv for the update. Not sure how familiar you are with Git. Would you be ok with squashing(rebasing) your commits down to a single commit?

@schalkneethling

Copy link
Copy Markdown

@maddhruv No worries, I see you worked directly on your master branch. This might be a little prickly and I do not want you to loose your work. In future, please create a feature branch instead of working directly on master.

https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow

@schalkneethling schalkneethling merged commit 05b5a31 into mdn:master Jan 22, 2018
@maddhruv

Copy link
Copy Markdown
Contributor Author

Thanks, @schalkneethling for your support. I actually didn't rebase

@wbamberg

Copy link
Copy Markdown
Contributor

Would you be ok with squashing(rebasing) your commits down to a single commit?

@schalkneethling , I just use the "Squash and merge" big green button, so contributors don't have to squash commits. Is there a reason I shouldn't be doing this?

@schalkneethling

Copy link
Copy Markdown

Is there a reason I shouldn't be doing this?

Nope. If the person is used to doing it with Git its a quick thing. Also, trying to guide people in the direction of rebasing once they have made final changes and expect a r+

Definitely not something that should block anyone from using the Github squash and merge and holding up a PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants