An evil witch cursed my switch statement so that no matter what I put in, it always executed the default clause instead of the case clauses.
This ...
For further actions, you may consider blocking this person and/or reporting abuse
Love it. That's really counterintuitive but makes sense.
As a carry over from working in c and c++ I've always enclosed any case blocks that define variables in curlies, since it avoids redeclaring variables if you have two cases declaring under one name (a similar issue to this one).
So, my code would be:
Damn, awesome job!! I mean, not as a JS expert, but, as a fellow programmer, I can only imagine the joy when finding this out!!