Monday, 24 April 2017

Exclamation mark before non-boolean variable [duplicate]

This question already has an answer here:

module.exports.signup = function(req, res) {
var username = req.body.username
var password = req.body.password
var password2 = req.body.password2

if (!username || !password || !password2) {
req.flash('error', "Please, fill in all the fields.")
res.redirect('signup')
}

So thats my code, Im wondering what the ! mark will do to a non-boolean variable like username?



via dtheman94

No comments:

Post a Comment