title: NodeJS - how to break a function?
body: <p>Recently had a similar question, but still can't get it. I have to validate registration page before adding new user.</p>
  
  <pre><code>app.post('/signup', function(req, res) {
      //checking if first name is filled
      if (req.body.first_name = "" || req.body.first_name = null || req.body.first_name = undefined) {
        res.render('signup', { "title": "Ttitle", "menu": "signup", user: req.user, "error" : "empty_first_name" });
        break;
      }
      //checking if last name is filled
      if (req.body.last_name = "" || req.body.last_name = null || req.body.last_name = undefined) {
        res.render('signup', { "title": "Ttitle", "menu": "signup", user: req.user, "error" : "empty_last_name" });
        break;
      }
      //checking if email is filled
      if (req.body.email = "" || req.body.email = null || req.body.email = undefined) {
        res.render('signup', { "title": "Ttitle", "menu": "signup", user: req.user, "error" : "empty_email" });
        break;
      }
      //checking if passwords match
      if (req.body.password != req.body.repassword) {
        res.render('signup', { "title": "Ttitle", "menu": "signup", user: req.user, "error" : "pass_missmatch" });
        break;
      }
      ...
      ...
      ...
      //and finally if everything seems to be OK...
      addUser(req.body.email, req.body.password, req.body.first_name, req.body.last_name, req.body.country, function(status) {
          res.render('signup', { "title": "Ttitle", "menu": "signup", user: req.user, "success" : 1 });
      });
  });
  </code></pre>
  
  <p>Node.JS tells me that all the breaks are illegial. But how should I break my function in a proper way? It doesn't return anything. Thanks!</p>