3
When I started studying Node.JS I came across the following code snippet:
Example with services that shows middleware Factory Advantages.
...
const {service} = options;
router.get('/greet', (req, res, next) => {
res.end(
service.createGreeting(req.query.name || 'Stranger')
);
});
return router;
What does this statement mean, why these {} in the service?
const {service} = options;
Read about Dismantling of objects
– Cmte Cardeal