my code:
function number(a){
return a
}
function x() {
return new Function("return number('22')")()
}
console.log(x())
I am experimenting with calling a function from a function using the new Function()() now when running this piece of code in a browser it is working just fine but when i run it in webstorm it throws the error below:
undefined:3 return number('22') ^
ReferenceError: number is not defined at eval (eval at x (C:\Users\WebstormProjects\tests.js:11:12), :3:1) at x (C:\Users\WebstormProjects\tests.js:11:47) at Object. (C:\Users\WebstormProjects\tests.js:13:13) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11