Why is my variable crossed out in VS Code?

Viewed 4391

When I define the variable name with

let name = 'synergy';

and the try to log it to the console using

console.log(name);

it executes fine but vscode crosses out name:

screenshot

I'm not sure what to do or why vscode is doing it.

1 Answers

In a browser, the global name variable has special meaning. It might be your linter just detecting and confusing the name word for your variable. Try changing the name to something else, and see if it is still crossed out.

Hope I helped!

Related