Prefer const vs let for variables that are only declared once

Requires that variable declarations use `const` instead of `let` and `var` if possible.

This is mostly for code readability, performance wins are debatable.
This commit is contained in:
Lukas Geiger
2018-05-30 19:47:28 +02:00
parent 4a4a17966a
commit 8989a09853
22 changed files with 153 additions and 152 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ export class CircularList<T> extends EventEmitter implements ICircularList<T> {
// Reconstruct array, starting at index 0. Only transfer values from the
// indexes 0 to length.
let newArray = new Array<T>(newMaxLength);
const newArray = new Array<T>(newMaxLength);
for (let i = 0; i < Math.min(newMaxLength, this.length); i++) {
newArray[i] = this._array[this._getCyclicIndex(i)];
}