Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my variable crossed out in VS Code? [duplicate]

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.

like image 727
Theo Robinson Avatar asked Nov 16 '25 05:11

Theo Robinson


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!

like image 148
GrimReaper07 Avatar answered Nov 17 '25 18:11

GrimReaper07



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!