Skip to content

Commit

Permalink
docs: update docs/src/rules/no-loop-func.md
Browse files Browse the repository at this point in the history
Co-authored-by: Nicholas C. Zakas <[email protected]>
  • Loading branch information
snitin315 and nzakas committed Sep 13, 2023
1 parent ce76e1a commit 5dd9f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/rules/no-loop-func.md
Expand Up @@ -34,7 +34,7 @@ In this case, each function created within the loop returns a different number a

This error is raised to highlight a piece of code that may not work as you expect it to and could also indicate a misunderstanding of how the language works. Your code may run without any problems if you do not fix this error, but in some situations it could behave unexpectedly.

This rule disallows any function within a loop that contains unsafe references (e.g. to modified variables from the outer scope). This rule ignores IIFEs but not async or generator functions.
This rule disallows any function within a loop, including async functions and generators, that contains unsafe references (e.g. to modified variables from the outer scope). This rule ignores immediately-invoked function expressions (IIFEs) because they do not persist outside of the loop and are therefore always safe.

Examples of **incorrect** code for this rule:

Expand Down

0 comments on commit 5dd9f24

Please sign in to comment.