I am generating a random number inside a javascript file that I need to pass through to an .ejs file. Obivously I can't just reproduce it there because it is random.
I am working with these files: app.js, game.js and game.ejs. I need to use the variable in both game files.
This is the variable I need to be shared
var num = Math.floor(Math.random()*4)
I already tried passing the variable through my app.js to the game.ejs which worked. I can still not work with it in my game.js though.
Any help is appreciated