Code Room
Code reviewMedium
Question
Review this TypeScript front-end component that renders a search results header.
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 renderHeader(container: HTMLElement) { const params = new URLSearchParams(window.location.search); const q = params.get('q') ?? ''; container.innerHTML = `<h2>Results for "${q}"</h2>` + `<a href="/search?q=${q}">Refine search</a>`;}Run or narrate your approach, then ask the coach.