Note to self:

if (typeof nameOfFunction == 'function') { 
    nameOfFunction(); 
}