Which keyword used to declare the variable in JavaScript
Answers
Answered by
5
Answer:
reserved keyword variables
JavaScript includes variables which hold the data value and it can be changed anytime. JavaScript uses reserved keyword var to declare a variable. A variable must have a unique name. You can assign a value to a variable using equal to (=) operator when you declare it or before using it.
Answered by
1
Always use 'var', 'let', or 'const' to declare JavaScript variables.
You must use 'var' if you want your code to run in an earlier browser. This is because, from 1995 to 2015, the 'var' keyword was used in all JavaScript code. In 2015, JavaScript received the 'let' and 'const' keywords. If you want a general rule, use 'const' when declaring variables. Use 'let' if you suspect the variable's value might change.
#SPJ3
Similar questions
Math,
4 months ago
Social Sciences,
4 months ago
English,
9 months ago
Physics,
9 months ago
English,
1 year ago