How to declare variable in Javascript?
Variables are used to store data in memory. JavaScript variables are declared with the var keyword.
var empname;
Multiple variables can be declared in a single step.
var empname, age, weight, gender;
After a variable is declared, it can be assigned a value.
empname = 'nathan';
Variable declaration and assignment can be done in a single step.
var empname = 'nathan';
No comments:
Post a Comment
Plz Share your comments...