JS if funciton exists code example
Example 1: check if function exists javascript
if (typeof payment === "function")
{
// Do something
}
Example 2: js check if function exists
if (typeof yourFunctionName == 'function') {
yourFunctionName();
}