The var keyword allows us to redeclare a variable without any issue:
var counter = 10;
var counter;
console.log(counter); // 10
However, if we redeclare a variable with the let keyword, we will get an error:
let counter = 10;
let counter; // undefined
by Luka Tatarishvili
4 years ago
JavaScript
variables
1
Pro tip: use ```triple backticks around text``` to write in code fences