Read more

What's wrong with defining JavaScript variables within if blocks? - Stack Overflow

Lexy
May 18, 2010Software engineer at makandra GmbH

Because javascript has something called "Hoisting" which makes your code do things it doesn't look like it should be doing. Basically, that means a javascript interpreter will move all var declarations, regardless of where they are in the body of a function, to the top of the function body.

Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot
Posted by Lexy to makandra dev (2010-05-18 21:14)