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//let and var are both editable variables and can be changed later on in your program;
2let dog = 'Woof';
3//dog is equal to the string 'Woof';
4dog = false;
5//You can changed the value of dog now because it was defined with let and not const;
6
7let cow = 'Moo';
8//cow is equal to the string 'Moo';
9cow = true;
10//You can change the value of cow later on because it is not defined with const;
11
12//const is used when declaring a variable that can't be changed later on -- const stands for constant;
13const pig = 'oink';
14//This assigns the string 'oink' to pig which can not be changed because it is defined with const;
15pig = 'snort';
16//Above throws an error
17//Good Job you now know how to declare variables using JavaScript!!!
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};