A simple way to overload JavaScript functions