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 user_name = prompt("Please enter your name:", "Type here");
2alert("Hello " + user_name);
1//You can make a variable by using:
2var variable-name = 'defenition of the variable';
3// Or you can use
4let variable-name = 'defenition of the variable';
1// let & var are both editable variables:
2var cow = 'moo';
3let pig = 'oink';
4cow = 10;
5pig = 10;
6// const is a permanent variable; you cannot change it.
7const uncuttableGrass = '\/\/';
8uncuttableGrass = '___';
9// above throws an error