Skip to content

Commit 5dd9f24

Browse files
snitin315nzakas
andauthored
docs: update docs/src/rules/no-loop-func.md
Co-authored-by: Nicholas C. Zakas <[email protected]>
1 parent ce76e1a commit 5dd9f24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/src/rules/no-loop-func.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In this case, each function created within the loop returns a different number a
3434

3535
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.
3636

37-
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.
37+
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.
3838

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

0 commit comments

Comments
 (0)