let numbers = Array.from({length:100}, (_,i)=>i);
for ( let i = 0; i < 10; i++ ) {
for (let j=0;j < 20; j++ ) {
let number = numbers [ i ];
}
}
This is the place where the compiler, interpreter or IDE could publish an error or a warning.
This is a clear situaion when a programmer wanted to use the key "j" but instead made a typo and used the key "i". Had he wanted to use the "i" key he would have initiated the variable "number" inside the first loop, not the second one.
In my opinion, future IDEs, compilers and interpreters could fixate such obvious errors and point them out to a programmer. Those bugs are often pretty hard to find.