/*** Name: Kofi Cypher Email: skcypher6@gmail.com Var The var keyword is used to declare variables globally or locally within a fucntion block It is suitable for use when you want to declare variables you would want to throughout your code execution. Let The let keyword is also used to declare variables. Here variables declared will only be available in the block where they were declared. This could be an if block or a function block. Suitable for declaring variables that are meant to be short lived or needed only in an execution block. Const The const keyword is used in declaring variables whose values will not change in the entire code execution. The cannot be declared without values. They are also block scoped like variable declared with the let keyword. Hoisting Hoisting in simple terms is when the execution/invoking of a function is done before the actual function or the assignment of a variable is done before the variable is declared. Usually found at the top of the function declaration or variable declaration. ***/ //Var var fruit = 'mango'; if (fruit === 'mango') { var fruit = 'orange'; console.log(fruit); //outputs orange } console.log(fruit); //outputs orange //Let let animal = 'bear'; if (animal === 'bear') { let animal = 'rabbit'; console.log(animal); //outputs rabbit } console.log(animal); //outputs bear //Const const instrument = 'guitar'; try { instrument = 'voilin'; } catch(err) { console.log(err); //returns an error } console.log(instrument); //outputs guitar