I've been diving into typescript recently and came across a simple code snippet that defines a constant variable and logs it to the console.
const versionNuber : number = 1.3;
console.log(versionNuber);
Upon running the tsc
command on the file, I noticed that the generated javascript code looked like this:
var versionNuber = 1.3;
console.log(versionNuber);
This led me to wonder how I can transpile the constant correctly in javascript.
Why doesn't tsc
convert it properly even though constants are supported in javascript?