Javascript function declaration or expression?

You may have heard of the different ways of declaring a function in JavaScript. It may seem a bit intimidating to newcomers as they need to learn and consider more, but actually, they aren’t so important except in a few situations.

There are a couple of different examples out there that demonstrate how choosing one can affect your code, but here, we just take a look at an important point to consider which is about placing functions correctly. Continue reading →