vinilla js to moniter if a function is called code example
Example: js check if function exists
if (typeof yourFunctionName == 'function') {
yourFunctionName();
}
if (typeof yourFunctionName == 'function') {
yourFunctionName();
}