I ship across the stack and catch what AI gets wrong.

Full-stack developer and AI evaluator, with a pharmacy background.

Anthony Ugwuja

Bugs from code a model wrote

I read its clinical and scientific answers the same way, looking for the mistake that survives a quick read.

Use the arrow keys for the next bug.

React - a price-sorted product list

function ProductList({ items }: { items: Product[] }) {
  const sorted = useMemo(
    () => items.sort((a, b) => a.price - b.price),
    [items],
  );

  return <ul>{sorted.map(renderRow)}</ul>;
}
() => [...items].sort((a, b) => a.price - b.price),

What breaks: sort() orders in place, so this reorders the caller's array as a side effect of rendering. Every other component holding that prop silently changes order too.

Bug 1 of 9: React - a price-sorted product list

Tools I use

  • React
  • Next.js
  • TypeScript
  • Tailwind CSS
  • Node.js
  • Python
  • Supabase
  • PostgreSQL
  • IndexedDB
  • Vercel
  • GitHub Actions
  • Playwright
  • Farcaster
  • Neynar
  • Gemini
  • Replicate