diff --git a/docs/rules/block-scoped-var.md b/docs/rules/block-scoped-var.md index 97be55b889c..75c7db02580 100644 --- a/docs/rules/block-scoped-var.md +++ b/docs/rules/block-scoped-var.md @@ -34,6 +34,13 @@ function doTryCatch() { var f = build; } } + +function doFor() { + for (var x = 1; x < 10; x++) { + var y = f(x); + } + console.log(y); +} ``` Examples of **correct** code for this rule: @@ -71,6 +78,13 @@ function doTryCatch() { f = build; } } + +function doFor() { + for (var x = 1; x < 10; x++) { + var y = f(x); + console.log(y); + } +} ``` ## Further Reading