JavaScript Hoisting

Introduction In this post I am going to talk about JavaScript. Recently I rediscovered this programming language, after a long time distance caused mainly by its quirks. However while working on my thesis I started to enjoy this language and I realized how much powerful it can be, if used in the correct way. “Do you want to work with the Web? Better learn JavaScript” said once a teacher of mine. Therefore with a series of posts I’m going to analyze those little irregularities that make JavaScript less intuitive, providing endless arguments to the people that hates it. Mastering these inconsistencies distinguish the experienced programmer with the newbie. Note: the article assumes some basic experience in JavaScript from the reader. Variable Hoisting Let’s start talking about “hoisting”. There are a couple of premises before diggin in the code. I’m assuming that you know the difference between declaration and initialization of...

Read More