Skip to content
Advertisement

how can i get the value of a variable outside the arrow function in mern stack

i want to get the value of this variable outside the function const custDetail = await registeredUser.findOne(req.params);

JavaScript

Advertisement

Answer

Edit a simple way to pass data to another function using res.locals

router:

JavaScript

dashboardReq

JavaScript

nextFunction

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement