Good day legendaries, I am Nodejs and Javascript newbie.
I have routes getting value from a common variable that is on top of them.
let commonVariable = "theDefaultValue";
//some route just to get commonVariable value
route.get("/", async (res, req) => {
});
//some routes below that change commonVariable value
route.post("/", async (res, req) => {
//changing commonVariable value
commonVariable = "anotherValue";
})
My concern is, how is the value of commonVariable
after some routes change it, will other routes get the original value?