bradxr
8/4/2018 - 11:31 AM

Explore Differences Between the var and let Keywords

Variables declared with the var keyword can be overwritten with another variable declaration without throwing an error, let keyword does not allow this

var vcamper = 'James';
var vcamper = 'David';
console.log(camper);  // David

let lcamper = 'James';
let lcamper = 'David';  // Throws error