complete-node-bootcamp icon indicating copy to clipboard operation
complete-node-bootcamp copied to clipboard

Changed the condition in the checkBody() middleware

Open cyborg7459 opened this issue 4 years ago • 0 comments

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

cyborg7459 avatar Sep 11 '20 17:09 cyborg7459