How to Refactor Long If or Switch Blocks with Double Dispatch in JavaScript · HackerTrans