JavaScript Best Practices— Variable Declarations, IIFEs, and Yoda
JavaScript is a very forgiving language. It’s easy to write code that runs but has mistakes in it.
In this article, we look at why we should put var
declarations on top, wrapping IIFES, and Yoda expressions.