function foo(a) {console.log(a);} foo(2)
VM20345:1 2
undefined
function foo(a){console.log(a+b)} var b = 2; foo(2)
VM20433:1 4
undefined
function foo(a){var b = a; return a + b;} var c = foo(2);
undefined
c
4
function foo(a){ console.log(a+b);b=a};foo(2);
VM20567:1 4
undefined
function foo(a){ console.log(a+c);c=a};foo(2);
VM20572:1 6
undefined
function foo(a){ console.log(a+c);c=a};foo(3);
VM20573:1 5
undefined
foo(3); function foo(a){ console.log(a+c);c=a};
VM20574:1 6
undefined
function foo(a){ console.log(a+v);c=v};foo(3);
VM20579:1 Uncaught ReferenceError: v is not defined
at foo (<anonymous>:1:32)
at <anonymous>:1:40
foo @ VM20579:1
(anonymous) @ VM20579:1