Why this matters
Cuts allocations and improves throughput on hot paths.
Prefer a single pass when possible (e.g., reduce) over multiple filter/map chains on the same array.
Cuts allocations and improves throughput on hot paths.
Side-by-side examples engineers can pattern-match during review.
const out = xs.filter(p).map(f).filter(q);const out = xs.reduce((acc,x)=>{ if(!p(x)) return acc; const y=f(x); if(q(y)) acc.push(y); return acc; },[]);arr.filter().map().filter()arr.reduce((acc,x)=>{/* combine */},[])From the same buckets as this rule.
All static JS/CSS/font/image files MUST use content-hashed filenames (e.g., app.9c1a7b.js) and be served with "Cache-Control: public, max-age=31536000, immutable". HTML and other non-fingerprinted documents MUST be served with "Cache-Control: no-cache" (or equivalent) to enable conditional revalidation.