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

replace forEach with for loop #49794

Closed
wants to merge 4 commits into from
Closed

replace forEach with for loop #49794

wants to merge 4 commits into from

Conversation

Ram1607
Copy link
Contributor

@Ram1607 Ram1607 commented Sep 22, 2023

Changes will replace forEach loop to for loop

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Sep 22, 2023
@tniessen tniessen added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Sep 22, 2023
Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

Please use for ... of instead of a traditional index-based for loop.

@Trott
Copy link
Member

Trott commented Sep 22, 2023

What is the reason for this change? I see the code-and-learn label so I guess it is from...Grace Hopper Day or something?

@tniessen
Copy link
Member

@Trott Yes, most occurrences of forEach predate support for for ... of. The latter allows const variables and works with non-arrays.

@Ram1607 Ram1607 changed the title Replace forEach with for loop replace forEach with for loop Sep 22, 2023
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 2, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 2, 2023
@nodejs-github-bot
Copy link
Collaborator

lpinca pushed a commit that referenced this pull request Nov 2, 2023
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: #49794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@lpinca
Copy link
Member

lpinca commented Nov 2, 2023

Landed in 196224c.

@lpinca lpinca closed this Nov 2, 2023
anonrig pushed a commit to anonrig/node that referenced this pull request Nov 9, 2023
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: nodejs#49794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Nov 11, 2023
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: #49794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Nov 14, 2023
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: #49794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: #49794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants