how to export timeOut variable in JS
I'm making a Js memory game using express and mongoose
i want to get hold of the attempts variable in
setTimout
alert. Can i export it into another js file??
Beacuse mainly i want to push that attempts variable in MonogoDB3 Replies
You could pass a callback into
checkForMatch
like:
Though if you're wanting the value to write it to Mongo, why not just write it where the match is found?you could return the current attempts number from the
incrementAttempts()
after you incremented it
and call that as the first line in checkForMatch(), stored in a variable
Wanted to have separate files for game logic and backend
Guess it was a bad decision
I'll try this