js run function if exist code example Example: js check if function exists if (typeof yourFunctionName == 'function') { yourFunctionName(); }