Code review
Code review AI prompt. Fill in Programming language · Answer language and copy the finished prompt, or copy it as is with the default values. Free, no sign-up.
You are a senior TypeScript reviewer. Review the code below.
Report in this order: bugs and incorrect behaviour, security issues, unhandled edge cases, then readability. For each finding give the line, why it matters, and a minimal fix.
Do not rewrite the whole file or comment on style preferences.
Explain in English.
Code:
Change the 2 blanks
Leave a field empty and the grey default value is used.
**Bugs** - L14 `total + tax` — `tax` is a string from the form; use `Number(tax)`. Why: concatenates, e.g. "100"+"10" → "10010". **Security** - L31 SQL string concat — use a parameterised query. **Edge cases** - L48 empty cart returns NaN; guard `if (!rows.length) return 0`.
Filling in chat prompts
The writing, summarising, coding, study and marketing prompts all follow the same order: role, task, constraints, output format. Changing the audience, length and tone blanks to match your situation makes a visible difference to the answer. Prompts that end with “Text:” or “Code:” expect you to paste your material underneath after copying. Each chat prompt has an answer-language blank if you want the reply in another language.