You may not always know which objects or functions the script contains, in such cases you can look for script tags that contain the required src file.
With jquery:
$("script[src*='"+scriptName+"']");
Without jquery:
document.querySelector("script[src*='"+scriptName+"']");
source share