関数を渡して返される値が「function」なので、それを利用して関数の有無を判定できます。
以下サンプルコードです。
See the Pen typeofで関数の有無を判定 by takapen (@takapen) on CodePen.
function testB(){};
console.log( 'log--Fn-- ' + (typeof function () { }) );//"log--Fn-- function"
console.log( 'log--a-- ' + (typeof testA));//"log--a-- undefined"
console.log( 'log--b-- ' + (typeof testB));//"log--b-- function"
if (typeof testA == 'function') {
console.log('done-- testA');//console.log 出ない
}
if (typeof testB == 'function') {
console.log('done-- testB');//console.log 出る
}