GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — replace forEach with for loop by Ram1607 · Pull Request #49794 · nodejs/node

Conversation

@Ram1607

@Ram1607 Ram1607 commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

Changes will replace forEach loop to for loop

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Ram1607
Replace forEach with for loop
492891e
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. 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
tniessen
tniessen reviewed Sep 22, 2023
View reviewed changes

@tniessen tniessen left a comment

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Ram1607
uses for... loop instead of index based loop
bdda894
Trott
Trott reviewed Sep 22, 2023
View reviewed changes
Comment thread test/parallel/test-dgram-socket-buffer-size.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott reviewed Sep 22, 2023
View reviewed changes
Comment thread test/parallel/test-dgram-socket-buffer-size.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Sep 22, 2023

Copy link
Copy Markdown
Member

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Ram1607
Remove trailing spaces
c6b6633
@tniessen

tniessen commented Sep 22, 2023

Copy link
Copy Markdown
Member

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

Trott reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Ram1607
Remove extra spaces
8f062fe
@Ram1607 Ram1607 changed the title Replace forEach with for loop replace forEach with for loop Sep 22, 2023
lpinca
lpinca approved these changes Nov 2, 2023
View reviewed changes
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 2, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 2, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 2, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55415/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

PR-URL: #49794
Reviewed-By: Luigi Pinca <[email protected]>
@lpinca

lpinca commented Nov 2, 2023

Copy link
Copy Markdown
Member

Landed in 196224c.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca lpinca closed this Nov 2, 2023
targos pushed a commit that referenced this pull request Nov 11, 2023
@Ram1607 @targos
test: replace forEach() with for...of
f8edbf0
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: #49794
Reviewed-By: Luigi Pinca <[email protected]>
@targos targos mentioned this pull request Nov 12, 2023
v21.2.0 release proposal #50681
Merged
targos pushed a commit that referenced this pull request Nov 14, 2023
@Ram1607 @targos
test: replace forEach() with for...of
90833a8
Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

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

PR-URL: #49794
Reviewed-By: Luigi Pinca <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
v20.11.0 proposal #51124
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Trott Trott Trott left review comments
@tniessen tniessen tniessen left review comments
@lpinca lpinca lpinca approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

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 Node.js core tests and test infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@Ram1607 @Trott @tniessen @nodejs-github-bot @lpinca
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.