Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarified compound assignment operator #29563

Closed
wants to merge 1 commit into from

Conversation

mighty-odewumi
Copy link
Contributor

Description

Added clarifying note on compound assignment operator &&.

Motivation

I hope to prevent confusion during usage of docs and give the reader a better understanding of the concept.

Additional details

Related issues and pull requests

Fixes #29524

@mighty-odewumi mighty-odewumi requested a review from a team as a code owner October 9, 2023 19:40
@mighty-odewumi mighty-odewumi requested review from Elchi3 and removed request for a team October 9, 2023 19:40
@github-actions github-actions bot added the Content:JS JavaScript docs label Oct 9, 2023
@@ -24,6 +24,7 @@ Logical AND assignment [_short-circuits_](/en-US/docs/Web/JavaScript/Reference/O
```js
x && (x = y);
```
Except that the expression x is only evaluated once.
Copy link
Contributor

Choose a reason for hiding this comment

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

[mdn-linter] reported by reviewdog 🐶

Suggested change
Except that the expression x is only evaluated once.
Except that the expression x is only evaluated once.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

@Josh-Cena
Copy link
Member

@mighty-odewumi As far as I'm concerned, we are not participating in Hacktoberfest (correct me if I'm wrong). Even if we do, please don't gamify the system—one PR for one concrete set of changes, not one PR per page. We don't want to merge ten PRs doing the same thing.

@mighty-odewumi
Copy link
Contributor Author

I'm not trying to game the system and I'm sorry if it came off as such.

I use a mobile phone to carry out the fixes and I am editing them all in the GitHub UI not a terminal. I'm not in a position to use a PC at the moment.

I thought one needs to commit and make a pull request as one makes changes in the GUI so as not to lose one's works. If not, I would have made all my commits a single Pull Request.

I'm sorry once again.

@Josh-Cena
Copy link
Member

Thanks for the explanation—I understand better now. We appreciate your passion for contributing, but do note that every PR sent is a notification for us and a new serial number created, which is unnecessary. I will assume good intentions, but just to be aware in your future open-source journey.

@mighty-odewumi
Copy link
Contributor Author

Thanks for your understanding. I will keep that in mind.

Sorry for the troubles.

@Josh-Cena
Copy link
Member

Are you able to update your PR in the next few days? We have a competing PR and yours came in slightly earlier, but we may favor the other one as well.

@mighty-odewumi
Copy link
Contributor Author

I don't think I would be able to. You can merge the other PR.

I guess there would be some other issues I could still contribute to later in the future.

Thanks.

@Josh-Cena
Copy link
Member

Thanks for your contribution still. Will look at the other PR.

@Josh-Cena Josh-Cena closed this Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

equivalence of x &&= y and x && ( x = y )
2 participants