ES 2015 — New Block-Level Variable Declarations

In contrast to other curly brace programming languages like C, C++, Java, or C#, JavaScript shows some unusual behavior. Take a look at this code snippet:

The multiple declarations of the wiggin variable in getWiggin suggests that the instance within the childIndex ===¬†1 branch is different from the other created in the childIndex¬†===¬†2 section….