Skip to content
Permalink
Browse files

Docs: clarify remedy to some prefer-const errors

  • Loading branch information...
turadg committed Dec 31, 2015
1 parent 994c8ee commit 2ef75497c963958298e1f4c9bff0c4d211514bbe
Showing with 10 additions and 0 deletions.
  1. +10 −0 docs/rules/prefer-const.md
@@ -37,6 +37,16 @@ The following patterns are not considered problems:
let a; // there is no initialization.
console.log(a);
// `i` gets a new binding each iteration
for (const i in [1,2,3]) {
console.log(i);
}
// `a` gets a new binding each iteration
for (const a of [1,2,3]) {
console.log(a);
}
// `end` is never modified, but we cannot separate the declarations without modifying the scope.
for (let i = 0, end = 10; i < end; ++i) {
console.log(a);

0 comments on commit 2ef7549

Please sign in to comment.
You can’t perform that action at this time.