Don't write code that fails silently eg. returns values like 'false', 'null', ... but rather throw specific errors on misuse of functions. saves tons of debugging time.
Working on a Front-end slicing when mid-project, designer goes: "Ah, I updated the designs and here's the latest version. I've changed 'just a few' things. If you have questions let me know"..