How to avoid duplicate if checks when overriding a method in JavaScript? - Kevin Powell - Community