Code Room
Code reviewMediumcr-g251
Subject XssLevel Mid–Senior~20 minCommon in Security interviewsIndustries Software development

Question

Review this client-side search-results renderer.

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
function renderResults(query, items) {  const box = document.getElementById('results');  box.innerHTML = '<h3>Results for ' + query + '</h3>';  for (const it of items) {    box.innerHTML += `<div class="row">${it.title}</div>`;  }}// query comes from location.search; items come from the API
Run or narrate your approach, then ask the coach.