why use var in javascript code example
Example 1: js variable
var Number = 5;
var String = "Hi!";
var boolen1 = true;
var boolen2 = false;
var array = [11, "Hi!", true];
var object = {age:11, speach:"Hi!", likes_Bananas:true};
Example 2: how to define variable in javascript
var <variable-name>;
var <variable-name> = <value>;
Example 3: var javascript
var text = "";
var i;
for (i = 0; i < 5; i++) {
text += "The number is " + i + "<br>";
}