complete-node-bootcamp
complete-node-bootcamp copied to clipboard
Changed the condition in the checkBody() middleware
req.body.name would return undefined not only when the name property is not inside the req.body object, but also when it exists, but it's value is 'undefined'. Thus, a better way to check whether a key is there in the object would be to use the 'in' keyword