Sometimes, real growth isn’t in learning new things, it’s in revisiting what you already know with a deeper mindset.
This week, I decided to go back to something I thought I had figured out: JavaScript array methods (.map(), .filter(), .reduce(), .find(), .forEach()... etc.)
Below is a breakdown of some common ones I revisited yesterday
1. .map() — transforms each item in an array and returns a new array.
let numbers = [1, 2, 3];
numbers.map(num => num * 2);
output: [2, 4, 6]
Reads like: “Go through the numbers array, multiply each element by 2, and return a new array.”
2. .filter() — keeps only the items that meet a condition.
Think: “Keep what matches, remove what doesn’t.”
let numbers = [1, 2, 3, 4];
numbers.filter(num => num > 2);
output: [3, 4]
Reads like: “Go through the array and keep only the numbers greater than 2.”
3. .find() — returns the first item that matches a condition.
Think: “Find me the first one that fits.”
let numbers = [1, 2, 3, 4];
numbers.find(num => num > 2);
output: 3
Can you explain what’s happening in this code? Drop your answer in the comments.
And if you can, please help us break down .reduce() too 😅
At first, revisiting these felt unnecessary, like repeating an old topic.
But the more I practiced, the more I realized how powerful and elegant these methods truly are.
They’re not just about looping through data, they train you to think differently about solving problems.
I’m learning that mastery isn’t about speed it’s about depth.
What’s one “basic” skill you’ve revisited recently that made you see things differently?
Abi una no dey revise??? 😁
#JavaScript #LearningInPublic #DeveloperJourney #WebDevelopment #ContinuousLearning #CodingMindset