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
Post a Comment