JavaScript scope chain tutorial - understanding js scope and scoping rules