React Learning Series – JavaScript Refresher ⚡️ Before hooks really clicked for me in React, ES6 did. I’ve been working through Academind’s React – The Complete Guide and I’m recapping what actually stuck. This post looks back at the JavaScript Refresher that made everything after smoother. Tiny wins from this week (see screenshot): • Built a small User class with greet() to cement OOP basics • Practiced immutable thinking with arrays: logged, pushed, then searched with findIndex • Replaced verbose callbacks with arrow functions (+ used default params where it simplified utilities) • Revisited ES modules (export / import) to organize logic before components/hooks Why this matters for React: • Arrow functions & destructuring → clearer prop handling, fewer callback gotchas • Spread/rest & array helpers → idiomatic, immutable state updates (great base for Redux Toolkit) • Modules → cleaner separation of components, hooks, and utilities • Async patterns (timers/callbacks) → better intuition for effects & data fetching flows Code: [https://lnkd.in/eJeGabrk] (I’ll also drop it in the first comment for easy access.) Next up: First React components + JSX—putting these ES6 habits inside real UI. #ReactJS #JavaScript #Frontend #WebDevelopment #LearningInPublic
Instead of findIndex you should have used indexOf. findIndex is for more complex data structures inside the array or more complex comparisons.
GitHub Link: https://github.com/premanpatel/react-prep-js-refresher