Using this solution, I'm trying to call my plugin's main function only if it exists, however the test fails despite the function actually existing (the plugin works properly on my page).
I changed my code a bit to perform the test first, then call the function anyway. I should see "yes" in the console since the plugin works, instead I see "no".
What am I doing wrong?
if (typeof owlCarousel === 'function') {
console.log('yes');
}
else {
console.log('no');
}
$('.owl-carousel').owlCarousel({
items: 1
});