Code Room
Code reviewHard
Question
Review this JS deep-merge used to apply user-supplied config over defaults.
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
function deepMerge(target, source) { for (const key in source) { if (typeof source[key] === 'object' && source[key] !== null) { target[key] = target[key] || {}; deepMerge(target[key], source[key]); } else { target[key] = source[key]; } } return target;}// usage: deepMerge(defaults, JSON.parse(req.body.config))Run or narrate your approach, then ask the coach.