Returning undefined for null, as well as changing dom functions is a great way to ensure unintended side effects will creep into your code.