There is external js that I call to the main page. This external file has a function
function fruitLib(){
}
I have another external js, and there is another function.
function price(){
}
Now, how can I check if there is fruitLib()before the call price()? Below I try, but it does not work (possibly because both files are external files).
if (typeof fruitLib== 'function') {
price();
}
Becky source
share