function outer(x) {
function inner(y) {
if (y) console.log(y);
else console.log(42);
}
inner(x + 1);
}
outer(5); // expect a logging of '6'
inner(); // expect a Reference Error
I know what it is supposed to do and I expect it to do just that but are there any cross-browser quirks or side effects I should be aware of when declaring inner functions.
[Edit]
By safe I meant is it possible they pollute global namespaces or are not treated as being local to the function they were declared in.
[/Edit]