Code Room
Code reviewMediumcr-g140
Subject Input validationLevel Mid–Senior~20 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this JavaScript signup validation handler.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewjs
app.post('/signup', (req, res) => {  const { email, bio } = req.body;  const emailRe = /^([a-zA-Z0-9]+)+@[a-zA-Z0-9]+\.[a-z]+$/;  if (!emailRe.test(email)) {    return res.status(400).json({ error: 'invalid email' });  }  const user = createUser({ email, bio });  res.status(201).json({ id: user.id });});
Run or narrate your approach, then ask the coach.