P
Patient Guy
Has anyone found it possible---that is, come up with a "trick"----to
specify IN THE SAME SCOPE 'const' for non-reassignable variables, with the
use of 'var' as a fallback should the interpreter respond with an error
upon seeing 'const'?
In pseudo-code:
try_this {
const SOME_CONSTANT = 0,
ANOTHER_CONSTANT = 1;
} or_try_this {
// re-assignable definitions despite not being wanted
var SOME_CONSTANT = 0,
ANOTHER_CONSTANT = 1;
}
Note that a try/catch block will fail presumably because they are in the
same scope, of which there are only two scopes in
ECMAScript/Javascript/JScript, as near as I can tell.
If that is asking for the existence of a logical contradiction, then what
other means is there to obtain this?
PG
specify IN THE SAME SCOPE 'const' for non-reassignable variables, with the
use of 'var' as a fallback should the interpreter respond with an error
upon seeing 'const'?
In pseudo-code:
try_this {
const SOME_CONSTANT = 0,
ANOTHER_CONSTANT = 1;
} or_try_this {
// re-assignable definitions despite not being wanted
var SOME_CONSTANT = 0,
ANOTHER_CONSTANT = 1;
}
Note that a try/catch block will fail presumably because they are in the
same scope, of which there are only two scopes in
ECMAScript/Javascript/JScript, as near as I can tell.
If that is asking for the existence of a logical contradiction, then what
other means is there to obtain this?
PG