if(typeof test === "function") { console.log('test is a function'); }else { console.log('test is not a function'); }