1//var variables can be re-declared and updated
2 var greeter = "hey hi";
3 var greeter = "say Hello instead";
4//it becomes a problem when you do not realize that a variable
5//greeter has already been defined before.
6
7//const declarations are block scoped
8//const cannot be updated or re-declared
9 const greeting = "say Hi";
10 greeting = "say Hello instead";// error: Assignment to constant variable.
11
12 const greeting = "say Hi";
13 const greeting = "say Hello instead";// error: Identifier 'greeting' has already been declared
14