I have a function that checks for the current stage in a sequential stream, based on a particular discipline that is passed in, and, according to that value, assigns the nex
Addording to : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
ES6 const is BLOCK-SCOPED, thus:
{
const TAG='<yourIt>';
console.log(TAG);
}
{
const TAG = '<touchingBase NoImNOt="true">';
console.log(TAG);
}
console.log(TAG); // ERROR expected
AFAICT, this is NOT a case of shadowing - each of the constants is soped correctly within its braces.
If we cannot re-use variable names, we will wind up with unreadable programs that obscure. rather than inform.
I believe the warning is wrong-headed