Постоянно терялся в этом вопросе
вот цитата:
Most languages with C syntax have block scope. All variables defined in a block (a list of statements wrapped with curly braces) are not visible from outside of the block. The variables defined in a block can be released when execution of the block is finished. This is a good thing.
Unfortunately, JavaScript does not have block scope even though its block syntax suggests that it does. This confusion can be a source of errors.
И так, функция:
var fizz() {
var a = 10
}
console.log(a) => undefined
Разве это не то самое, что описывается в цитате?