1//Making variables with let:
2let numberOfFriends = 1;
3
4//Incrementing:
5numberOfFriends += 3; //numberOfFriends is now 4
6
7// Variables with const
8const minimumAge = 21; //CANNOT REASSIGN!
9
10//Booleans - true or false values
11true;
12false;
13let isHappy = true;
14
15//Naming Conventions
16// Use upper camel-cased names:
17let numberOfChickens = 6; //GOOD
18// NOT THE JS WAY:
19// let number_of_chickens = 6;
1var a;
2console.log(a); // scrive in console "undefined" o "" a seconda del browser usato.
3console.log('still going...'); // scrive in console "still going...".
1// JS Variables
2var varExample = "var"; // var is use for variable in js the problem with it that it has complicated scope
3let letExample = "let"; // let is pretty much same as var the only thing which make its more varriable is its variable scope.
4const constExample = "const"; // const is use for constant values and this variable scope is sane as let
1var is a keyword to define the varible in js but as of es-6 we, use let and const keywords for the same