Currently, I am delving into the world of TypeScript and below you can find the code that I have been working on:
const addNumbers = (a: number, b: number) => {
return a + b
}
var addNumbers = function (a, b) {
return a + b;
};
The index.ts file suddenly started showing an error.
Cannot redeclare block-scoped variable 'addNumbers'.ts(2451) index.js(1, 5): 'addNumbers' was also declared here.
I am utilizing Visual Studio Code for this development. Why is this error occurring?