useReducer finally makes sense… because I built a project with it. 😄
React Quiz App json-server fake API.
Here’s what I learned 👇 dev.to/usama_dev/today-final…
🌍 JavaScript Scopes & Closures in 1 tweet:
Global 🌍 → everywhere
Function 🔧 → inside function
Block 🧱 → inside { }
Lexical 🧭 → depends on where written
Closure 🔒 → function remembered scope
Master these → write cleaner JS 🚀
#JavaScript#100DaysOfCode
🔄 JavaScript for...x loops :
for (let i=0; i<3; i ) {} // counter loop
for (const i in arr) {} // keys / indexes
for (const v of arr) {} // values
⚡ Remember:
for → count
for...in → index
for...of → value
👉 Easy rule: in = index, of = values
This bug wasted me hours 😅
Sharing so the next dev saves time.
If your React Netlify site shows only a white screen,
👉 check _redirects and deploy settings first.
#React#Netlify#WebDev#Frontend
Just deployed my React app to Netlify…
Local build worked ✅
Netlify Preview worked ✅
But Production build? ❌ Just a white screen.
Console error:
Uncaught SyntaxError: Unexpected token '<'
Here’s how I fixed it 🧵