When does a variable have a local scope?

When we create it inside of a function's blockVariables always have a local scope

When we create it inside of a function's block.