question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule proposal: `no-array-for-each`

See original GitHub issue

for...of is more readable.

Fail

foo.forEach(x => callback(x));

Pass

for (const x of foo) {
	callback(x);
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
fregantecommented, Jan 17, 2021

For reference, there’s a prefer-for-of too, but it’s against regular for loops: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md

Read more comments on GitHub >

github_iconTop Results From Across the Web

SEC Proposed Rules
SEC Proposed Rules · Regulation NMS: Minimum Pricing Increments, Access Fees, and Transparency of Better Priced Orders · File No: S7-30-22 · Comments...
Read more >
eslint-plugin-unicorn/no-array-for-each.md at main - GitHub
This rule is automatically fixable by the --fix CLI option and manually fixable by editor suggestions. Benefits of for…of statement over the forEach ......
Read more >
Proposed Rules - GovInfo
This proposed rule, if finalized, would harmonize certain sections of FDA's regulations on human subject protection and institutional review ...
Read more >
Reopening of Comment Periods for “Private Fund Advisers
The Securities and Exchange Commission (``Commission'') is reopening the comment period for a release proposing new rules and amendments to ...
Read more >
Check-in Differences - System.Data.SQLite.org.
... to add to the global "no" array). # foreach {name value} $test_flags(-no) ... used to ends the loop */ union { /*...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found