Wednesday, June 5, 2024
168
rated 0 times [  175] [ 7]  / answers: 1 / hits: 5152  / 3 Years ago, sat, march 27, 2021, 12:00:00

Here is my Javascript code on VS Code:


const
var


In the console.log(name variable); the name variable is displayed with a strikethrough symbol on VS Code. But the result showing on my browser is right (no error).


Also, the tooltip shown on VS Code is "const name : void".


The same thing is happening if I use


document.getElementById('demo10').innerHTML = name;

or


document.write(name);

var name = 'Smith';
document.getElementById('demo10').innerHTML = name;
console.log(name);

More From » visual-studio-code

 Answers
2

Short Answer:


name is an obsolete property of the Window object. When you see a strikethrough on a variable, VS Code knows that it is deprecated.


Long Answer:


What is the name keyword in JavaScript?


[#1582] Monday, March 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
melinal

Total Points: 367
Total Questions: 101
Total Answers: 96

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
melinal questions
Thu, Dec 2, 21, 00:00, 3 Years ago
Tue, Jun 15, 21, 00:00, 3 Years ago
Tue, Feb 25, 20, 00:00, 4 Years ago
Tue, Sep 3, 19, 00:00, 5 Years ago
;