๐ Array Methods X Shaka Laka Boom Boom : A Childhood Magic in JavaScript!
A story where there is magic โจ and coding ๐ป!

Hellooo Techiess ! Doy you remember the excitement of watching Shaka Laka Boom Boom as a kid ? The thrill when Sanjuโs magic pencil brought his drawing to life ? Imagine if JavaScript have a similar magic tool โ well guess what ? it does ๐ชโจ.
Just like Sanju used his magic pencil to solve problems, fight the villains, and go on adventures with his friends. Javascript has array methods that make the coding magical !
So, in this blog we will relive our childhood memories while exploring the top 10 JavaScript array methods, i will explain you all in a fun and easy way. So grab your magic pencil ( Keyboard ), and letโs start drawing some powerful code in the code editor ๐๐ป.
๐ 1. forEach() - Helping Friends
Sanju used his magic pencil to help his friends. Just like forEach(), which helps us to do something for every item in an array.
let friends = ["Changu", "Mangu", "Karuna", "Raju"];
friends.forEach(friend) {
console.log(`${friend} is helped !`)
}
๐ก 2. map() - Magic Shield
A gangster tried to steal the pencil ! Sanju quickly draw a magic shield that blocked every attack. The map() method works the same way. It changes every item in an array.
let attacks = ["Fire", "Ice", "Laser"];
let shield = attacks.map(attack => `Blocked ${attack}`) {
console.log(shield)
}
๐ 3. filter() - Flying Elephant
Sanju draw a flying elephant that only carried good peoples. The filter() method also selects only the right item from an array.
let people = [
{ name: "Raju", good: true },
{ name: "Gangster Uncle", good: false },
{ name: "Karuna", good: true }
];
let goodPeople = people.filter(person => person.good) {
console.log(goodPeople)
}
๐ 4. find() - Dancing Shoes
Sanjuโs magic shoes fit only one person! The find() method also finds only the first matching item.
let shoes = [36, 38, 40, 42, 44];
let mySize = shoes.find(size => size === 42) {
console.log(mySize);
}
๐ถ 5. some() - Talking Dog
Sanju draw a talking dog that barked when danger was near. The some() method checks if atleast one item matches a condition.
let noises = ["Growling", "Sighing", "Howling", "Grunting"];
let isBarking = noises.some(noise => noise === "Growling") {
console.log(isBarking); // true
}
โณ 6. every() - Time Machine
Sanju draw a time machine, but it only worked if all the buttons were correct! The every() method checks if all items in an array meet a condition.
let buttons = [true, true, true, true];
let timeMachineWorks = buttons.every(button => button === true) {
console.log(timeMachineWorks); // true
}
๐ฒ7. reduce() - Treehouse
Sanju made a treehouse by joining small wooden pieces. The reduce method combines all values in an array into one.
let woods = [2, 3, 5, 7];
let totalWood = woods.reduce((total, wood) => total + wood, 0) {
console.log(totalWood);
}
๐ค 8. Sort() - Giant Robot
Sanju draw a giant robot that arranged things in order. The sort() method also arranges values in order.
let robots = [200, 100, 500, 300];
robots.sort((a, b) => a - b);
console.log(robots);
๐ธ 9. splice() - A Friend Shaan
Sanjuโs alien friend Shaan could remove things from the middle. The splice() method removes or replaces items in an array.
let aliens = ["Shaan", "Xylo", "Zara", "Momo"];
aliens.splice(1, 2); // Remove "Xylo" & "Zara"
console.log(aliens);
๐ซ 10. concat() - Jadoo High School
Sanju and Shaan went to Jadoo High School, where two classes merged. The concat() method joins two arrays together.
let class1 = ["Sanju", "Shaan"];
let class2 = ["Raju", "Karuna"];
let jadooHigh = class1.concat(class2) {
console.log(jadooHigh);
}
๐ฏ Conclusion
ust like Sanjuโs magic pencil brought things to life, these array methods transform data in JavaScript! ๐จ๐ป
If you loved Shaka Laka Boom Boom and want to master JavaScript, these array methods are pure magic! ๐
If you enjoyed this blog, share and comment! ๐โจ Happy coding!