Code Room
Code reviewMediumcr-g535
Subject Code reviewLevel Mid–Senior~16 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this JavaScript cart total + tax routine.

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 total(items, taxRate) {  let sum = 0;  for (const it of items) {    sum += it.price * it.qty;  }  const withTax = sum * (1 + taxRate);  return Math.round(withTax * 100) / 100;}// total([{price: 0.1, qty: 3}], 0)  -> ?
Run or narrate your approach, then ask the coach.