Code Room
Code reviewMedium
Question
Review this JavaScript invoice line-item total.
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 lineTotal(unitPriceUsd, qty, taxRate) { const subtotal = unitPriceUsd * qty; const tax = subtotal * taxRate; const total = subtotal + tax; return Math.round(total * 100) / 100;} // lineTotal(0.10, 3, 0.0); -> expected 0.30Run or narrate your approach, then ask the coach.