English, asked by ashrss6308, 9 months ago

Which keyword used to declare the variable in JavaScript

Answers

Answered by aayushi7564
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 mahajan789
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