javascript variables code example
Example 1: var javascript
var text = "";
var i;
for (i = 0; i < 5; i++) {
text += "The number is " + i + "<br>";
}
Example 2: 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 3: javascript declare a variable
var myVariable = 22;
let myVariable = 22;
const myVariable = 22;
Example 4: js variables
var varExample = "var";
let letExample = "let";
const constExample = "const";
Example 5: js variables
let numberOfFriends = 1;
numberOfFriends += 3;
const minimumAge = 21;
true;
false;
let isHappy = true;
let numberOfChickens = 6;
Example 6: javascript variables
var e_number = 0;
var e_string = '';
var e_true = true;
var e_false = false;
var e_undefined = undefined;