I have two javascript docs on my project.
js (script.js) #1:
let func = new Function('return thisvar')
console.log(func())
js (script1.js) #2:
let thisvar = 'hello'
I get an error:
ERROR:{@script.js line 4: cannot find variable 'thisvar'}
I have tried using var instead of let or even window.thisvar
What am I doing wrong?