JSFiddle - React, Tailwind, and code Playground
JavaScript
function foo() { alert('foo') }
if (foo && typeof foo === 'function') {
foo();
}
function foo() { alert('foo') }
if (foo && typeof foo === 'function') {
foo();
}