const es6 mozilla code example
Example 1: const let var scope
var num = 1; //var can be function or global scoped
const num = 2; //const can only be block scoped
let num = 3; //let can only be block scoped
Example 2: const js +=
const foo; // Errror as const cannot be kept un-initialized;
const foo = "foo";
console.log(foo); //Output: foo
foo += " bar"; //Error