DRY Code: Using IIFEs to Clean Up Code

2 min read

DRY: Don’t Repeat Yourself

As you may have seen in my last post, I have some ridiculous conditional statement blocks going on to show/hide the Skycons and for switching up the background photos based on your current weather conditions.

Each of this if/else statements is essentially repeating the same couple of ideas: