Trying to get the hang of 'TypeScript in 5 Minutes' but running into some issues:
https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
Despite my efforts, I keep encountering one error after another, which is not ideal when I'm attempting to showcase TypeScript to a colleague.
For instance, when I use this basic example (the very first one):
function greeter(name) {
return 'Hello ' + name;
}
let user = 'Test';
console.log(greeter(user));
Even with this straightforward TypeScript snippet, I end up facing 2 errors.
First Error - The function declaration of 'greeter' is flagged as a 'Duplicate Function Declaration'
Second Error - The declaration of 'user' prompts a 'Cannot redeclare block scoped variable user' message
https://i.sstatic.net/QvUw3.png
I've revisited the guides several times without encountering such problems before.
I've tried disabling any potentially conflicting Plugins like Prettier or ESLint, yet the errors persist.
Initially, I faced challenges due to an incorrect PATH variable that was leading TypeScript to version 1.0.0.3. However, I have corrected this and now have the right TSC version.
Can't seem to understand why I'm getting errors even with such a simple example?
Any tips or suggestions would be greatly appreciated.