Using the switch(true) pattern in JavaScript | Hacker News Reader