1//choose the best for your solution
2var myVariable = 22; //this can be a string or number. var is globally defined
3
4let myVariable = 22; //this can be a string or number. let is block scoped
5
6const myVariable = 22; //this can be a string or number. const is block scoped and can't be reassigned
1//choose the best for your solution
2var myVariable = 22; //this can be a string or number. var is globally defined
3
4let myVariable = 22; //this can be a string or number. let is block scoped
5
6const myVariable = 22; //this can be a string or number. const is block scoped and
1var one = 1; // variable stores numeric value
2
3var two = 'two'; // variable stores string value
4
5var three; // declared a variable without assigning a value
6
1var myVar; //unitialized variable( can be intiallized later )
2var number = 1; //number
3var string = " hello world " ; //string
4var boolean = true ; //boolean
5myVar = function(){ //variable can hold function
6
7};