sure
function usingVar() { if (true) { var foo = 'bar'; } console.log(foo); } This works fine, because var is function-scoped, and the above is actually translated to something like this: function usingVar() { var foo; if (true) { foo = 'bar'; } console.log(foo); }
http://bfy.tw/OQOd
Обсуждают сегодня