Imaginer les affichages :
var a = 1;
function outer() {
var b = 2;
console.log(" test 1 ", a, b);
function inner() {
a = 3;
b = 4;
c = 5;
}
inner();
console.log(" test 2 ", a, b, c);
}
outer();
console.log(" test 3 ",a, b);
JS Bin on jsbin.com