FreeCodeCamp : Compare Scopes of the var and let Keywords

FreeCodeCamp : Compare Scopes of the var and let Keywords
0

#1

On the RHS console, I’ve pasted the problem that is explained in the LHS section.

I’m not getting why it’s throwing me an error when pasted on Console, while FreeCodeCamp doesn’t claim to happen so.

Can someone help me out?

Below is the link
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords


#2

The error is telling you that the variable has already been declared

Indeed you had previously declared it in the same scope with var and then later with let

You can’t redeclare a variable, even though you can reassign it, in the same scope