Skip to content

Shortcut to checking if a value exist in an object

So I’m trying to get a shortcut to return a value in an object. For example, Now, if I want to do days.Thursday, that value will be undefined, so if I do days.Thursday, it will return undefined, but I would like for it to return 0, if it is undefined. My method of doing this would be to do: But

Cannot access variable using await-async function

I tried using Async-Await in NodeJs RESTful API but I seem to get an error I cannot resolve. Here is my db.js: And here is my api.js: When making a HTTP request, my server is crashing at that point. Where is my mistake? Answer You’re mixing your variable names up. You have user as an import, but you als…