Skip to content

Instantly share code, notes, and snippets.

es6 - new variable declarations - let and const - 4.js
let firstname = 'John';
console.log(firstname); // ouputs: John
let firstname = 'Jane'; // Error: Uncaught SyntaxError: Identifier 'firstname' has already been declared
firstname = 'Jane';
console.log(firstname); // ouputs: Jane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment