Closed saneef closed 3 years ago
The const to let conversion in for statement creates wrong code:
const
let
Before:
for (const i: number = 0; i < 20; i++) { console.log(i); }
After:
letconst i: number = 0; i < 20; i++) { console.log(i); }
This is an issue in the Typescript itself. You can reproduce it here also:
https://www.typescriptlang.org/play?#code/LAKAZg9gTgBAFAYwgOwM4BcYEsBcNkCuAtgEYCmsAvDAAwDc2MAPDAEz3YDUnAlDAN6gYwmEjQQANmQB0EiAHM4WHqAC+oIA
I'd suggest reporting that at https://github.com/microsoft/TypeScript/issues, if it's not already.
The
const
tolet
conversion in for statement creates wrong code:Before:
After: