React Learning Series: JavaScript Refresher for React

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

  • Screenshot showing a User class with constructor/greet(), creation of user1, a hobbies array updated with push('working'), and findIndex using an arrow function to locate "sports".

Instead of findIndex you should have used indexOf. findIndex is for more complex data structures inside the array or more complex comparisons.

See more comments

To view or add a comment, sign in

Explore content categories