Code Room
Code reviewMedium
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.
Learn the concepts
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.