i need a way to call variables in a file dynamic, in the front end if you create a variable outside a function its put it on the window object and then you can get it using
window['nameOfVar']
i have tried do it with this instead of window in nodejs but i got nothing.
const self = this;
var temp = 'im dynamic'
console.log(self['temp']) // this will print undefined in nodejs
is there a way to achieve this behavior