Assigning vs overriding

Tell us what’s happening:
I can’t get the what’s the difference between let keyword and const keyword.
Plz explain it clearly…

Your code so far

function printManyTimes(str) {
"use strict";

// Only change code below this line

var sentence = str + " is cool!";
for (var i = 0; i < str.length; i+=2) {

// Only change code above this line


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36.

Challenge: Declare a Read-Only Variable with the const Keyword

Link to the challenge:

Const, as the name suggest is a constant that never be changed by reassignment. Although, referenced values (objects) can still be changed in memory, but not by reassignment though. let on the other hand is a bit similar to the old var, and it’s values can be changed by reassignment.

// allowed
let x = 6;
x = 9;

// not allowed
const y = 9;
y = 10; // this throw an error
y++; // this also throw an error