I got this global function function:
GlobalFunctions = {
      something: function() {
      }
};
I know how to check if a function exists with this:
if (typeof functionName == "function")
or even better:
if (typeof functionName === "function")
but those I have mentioned above still return the next error when I an trying to find out if a global function is valid:
if (typeof GlobalFunctions.something == "function")
gives this:
angular.js:12520 ReferenceError: GlobalFunctions is not defined
    at r.$scope.continueLogout (my-app.js:197)
    at b.$scope.logout (my-app.js:243)
    at fn (eval at compile (angular.js:13365), <anonymous>:4:209)
    at e (angular.js:23613)
    at b.$eval (angular.js:16052)
    at b.$apply (angular.js:16152)
    at HTMLAnchorElement.<anonymous> (angular.js:23618)
    at HTMLAnchorElement.dispatch (jquery.min.js:3)
    at HTMLAnchorElement.q.handle (jquery.min.js:3)
I have searched in google but only found solutions for function but not for global functions.
Hope thats clear enough, thanks.
 
    