javascript - Different behavior in browser and nodejs on calling typeof in new Function -


the following code behaving differently in broswers , nodejs:

var = function() {};  var isfunction = function(funcname){       var f =   new function ("return typeof " + funcname + "=== 'function'");       return    f();  }; console.log(isfunction("a")); 

in browsers, logs true. however, saving js file , running in nodejs, logs false. can let me know why?


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -