javascript variable declaration rules code example
Example 1: javascript variable
var user_name = prompt("Please enter your name:", "Type here");
alert("Hello " + user_name);
Example 2: how to define variable in javascript
var <variable-name>;
var <variable-name> = <value>;
Example 3: how to declare variables javascript
var x = 10;
var dog_name = "daisy";
var dog_name = 'daisy';
Example 4: javascript variable declaration
var name = "mamama";
document.write(name);
Example 5: javascript variables
var e_number = 0;
var e_string = '';
var e_true = true;
var e_false = false;
var e_undefined = undefined;