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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -