const a = 3; let b = 2; var c = 1;
const a = 3; let b = 2; var c = 1; // a = 4; error a cannot be re-assigned b = 3; //OK c = 4; //OK
function someFunction() { if( someCondition ) { const a = 3; let b = 2; var c = 1; } // a and b are deleted // console.log(a); error a doesn't exist // console.log(b); error b doesn't exist console.log(c); // OK, c exists within the // entire function }