New to javascript. I want to check if temp is a function or not. Also I would like to know why typeof won't work in this situation : Situation where a function is passed as a parameter. Understanding it is my purpose so no jQuery please. Appreciate all the help. Thanks
function getParams(foo, bar) {
if (typeof bar === 'function') console.log("bar is a function");
console.log(typeof bar); // string: because i returned string. But why not a "function" ?
}
function temp(element) {
return element;
}
function runThis() {
getParams("hello", temp("world"));
}
runThis();