🚀 Day 7 of My 30 Days of JavaScript Challenge 🧩 Problem: Array Reduce Transformation (LeetCode #2626) Given an integer array nums, a reducer function fn, and an initial value init, return the final reduced value. You must solve this without using the built-in Array.reduce() method. 💻 Language: JavaScript 📖 Problem Link: https://lnkd.in/eDiXhyPm 💡 Solution: https://lnkd.in/ezvK8_tY 🧠 Concepts Used Higher-order functions Accumulator pattern Sequential computation Understanding reduce() core logic 📚 Takeaway Rebuilding reduce() helps you understand how JavaScript aggregates data step by step. This concept is foundational for advanced topics like state management, data pipelines, and functional transformations. #Day7 #JavaScript #30DaysOfCode #LeetCode #WebDevelopment #FunctionalProgramming #CodingChallenge #FrontendDevelopment #100DaysOfCode
Solving Array Reduce Transformation without Array.reduce() in JavaScript
More Relevant Posts
-
🔍 Day 168 of #200DaysOfCode Today, I focused on filtering specific values from an array — in this case, extracting only odd numbers using basic loop logic in JavaScript. ✔ This exercise reinforces how important condition checking is while working with data. ✔ Instead of using advanced built-in methods like .filter(), I wrote the logic manually — which improves clarity and confidence in how loops operate. ✅ What I practiced today: • Iterating through arrays • Checking conditions using modulo % • Selectively pushing results into a new array • Handling edge cases (like when no odd numbers exist) 🌱 Filtering is a skill that scales — from small number lists to large datasets powering real-world apps. Strong fundamentals → Strong code → Strong developer 💪 #JavaScript #168DaysOfCode #CodingChallenge #BackToBasics #LearnInPublic #ProblemSolving #WebDevelopment #DeveloperMindset #LogicBuilding
To view or add a comment, sign in
-
-
🧩 #100DaysOfCode – Day 32 | JavaScript Variables & Data Types 💛 Moving deeper into JavaScript! 🚀 Today I learned about variables — the containers that hold data — and data types, which define what kind of value we store. 💡 🔑 Key Points: 🟢 var, let, const → used to declare variables. 💬 Data Types: String → "Hello" Number → 25 Boolean → true / false Array → [1, 2, 3] Object → {name: "Shalini", age: 19} 💡 “Variables are like storage boxes — label them right, and coding becomes smooth!” 🌸 #100DaysOfCode #Day32 #JavaScript #FrontendDevelopment #CodingJourney #LearnByDoing #WebDevelopment #WomenInTech
To view or add a comment, sign in
-
-
#100DaysLearningChallenge with Saurabh Shukla Sir. 🎯 Day 19: Set in JavaScript — Ensuring Uniqueness and Efficiency 🔁✨ Yesterday, I worked with the Priority Queue, mastering how priorities influence data processing. Today, I explored another powerful built-in data structure — the Set — a simple yet efficient way to manage unique collections of values in JavaScript. 🧠 What’s a Set? A Set is a special type of collection that stores unique values, whether primitive types or object references. It automatically removes duplicates, making it a great tool for scenarios where uniqueness is essential. 🛠️ What I learned and implemented: ✅ Created and managed Sets to store unique data ✅ Added, deleted, and checked elements efficiently ✅ Explored key Set methods like add(), delete(), has(), and clear() ✅ Practiced converting between Arrays and Sets ✅ Used Sets to eliminate duplicates from arrays effortlessly 📂 Real-world use cases: ➡️ Removing duplicates from data collections ➡️ Managing unique user IDs or tokens ➡️ Tracking visited nodes in graph algorithms ➡️ Optimizing lookups and membership checks 👨💻 Sets may seem simple, but they play a crucial role in writing cleaner, faster, and more reliable code. 📒 Try creating your own examples — experiment with methods and combine Sets with other data structures for powerful results! 📹 Video reference (MySirG): https://lnkd.in/gfu-c8Tb 💻 Source Code (GitHub): https://lnkd.in/gStvbMtw 🚀 From managing priorities to maintaining uniqueness — every day, one concept stronger! #100DaysLearningChallenge #Day19 #Set #JavaScript #DataStructures #CleanCode #LearningInPublic #DevJourney #AlgoDaily #CodeSmart
Set Data Structure in JavaScript | Duplicate हटाओ Boss! | JS में Set का Magic Explained
https://www.youtube.com/
To view or add a comment, sign in
-
🚀 Day 7 of My 30 Days of JavaScript Journey ✅ Challenge: Array Reduce Transformation (LeetCode #2626) Write a function reduce(nums, fn, init) that processes each element of the array using the given reducer function fn, starting from an initial value init. This function should accumulate results sequentially and return the final value — implemented without using the built-in Array.reduce() method. 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/gxsp26cz 💡 Solution: https://lnkd.in/giZj_hYw 🧠 Concept Highlighted: This problem deepened my understanding of accumulator functions, data aggregation, and sequential computation in JavaScript. It helped me explore how the powerful reduce() method works behind the scenes — a key tool for transforming and summarizing data efficiently. #Day7 #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #LearningEveryday #ProblemSolving #FunctionalProgramming
To view or add a comment, sign in
-
🟦 Day 182 of #200DaysOfCode Today, I explored one of the most important concepts in JavaScript data handling — ✨ Deep Cloning a Nested Object Manually. In JavaScript, objects are stored by reference. So if you simply assign or shallow copy an object, any nested changes will still affect the original one. To truly create an independent copy, we need a deep clone — where every nested level is recreated. 🔍 What I built: A custom deepClone() function that: ✔ Loops through every key in the object ✔ Checks if a value is another object ✔ Uses recursion to clone deeply nested structures ✔ Returns a completely separate copy Why this matters? Deep cloning is essential when working with: • React state management • Redux reducers • Complex forms • API response manipulation • Saving snapshots of data without mutation 🧠 Key Takeaways: • Understanding reference vs value is crucial in JS • Recursion is a powerful tool for traversing deep structures • Manual deep cloning builds strong mental models of how objects behave • These fundamentals help you write safer, more predictable code This was one of those exercises where a simple concept reveals a deeper layer of how JavaScript actually works behind the scenes. Master the basics → scale effortlessly into advanced topics. #JavaScript #182DaysOfCode #LearnInPublic #DeepClone #Recursion #ProblemSolving #WebDevelopment #LogicBuilding #CodingChallenge #DeveloperMindset #ObjectsInJS
To view or add a comment, sign in
-
-
🚀 𝗗𝗮𝘆 𝟮𝟯 𝗼𝗻 𝗟𝗲𝗲𝘁𝗖𝗼𝗱𝗲 Today I tackled one easy and one medium problem -- focusing on using objects to efficiently track array elements and their counts. 🧠 𝗜 𝘀𝗼𝗹𝘃𝗲𝗱: 🔹 1207. Unique Number of Occurrences 🔹 287. Find the Duplicate Number 💡 𝗞𝗲𝘆 𝘁𝗮𝗸𝗲𝗮𝘄𝗮𝘆: Objects can be super useful when you need to count, track, or compare array members efficiently. A solid step toward better data handling in JS 💪 #LeetCode #JavaScript #LearnInPublic #BuildInPublic #ProblemSolving #100DaysOfCode #WebDevJourney
To view or add a comment, sign in
-
-
📘 Day 175 of #200DaysOfCode Today, I explored how to count the number of properties in a JavaScript object — a small but meaningful step toward understanding how objects truly work under the hood. 🧠 Key Concepts Practiced • Working with objects • Looping through keys using for...in • Using hasOwnProperty() to avoid inherited keys • Returning calculated output 🌍 Real-World Uses ✅ Validating form inputs ✅ Checking JSON response structures ✅ Data integrity checks ✅ Object analysis in APIs 🔎 Learning takeaway: Even the simplest operations help you develop a deeper understanding of core JavaScript behavior. Mastering the fundamentals builds confidence for tackling complex problems later. #JavaScript #Day175 #175DaysOfCode #ProblemSolving #CodingChallenge #WebDevelopment #LogicBuilding #BackToBasics #LearnInPublic #DeveloperJourney #CodingMindset
To view or add a comment, sign in
-
-
🚀 Master JavaScript Arrays — From Basics to Advanced! Arrays are the backbone of data manipulation in JavaScript — from handling lists of items to building complex data structures. 📊 This guide covers everything you need to know — ✅ Creating, accessing, and modifying arrays ✅ Copying & cloning techniques (mutable vs. immutable) ✅ Modern methods like toReversed(), toSorted(), toSpliced(), and with() ✅ Deep dive into static & iterator methods (map, filter, reduce, find, flatMap, and more) ✅ Practical exercises and real-world challenges Whether you’re a beginner brushing up your fundamentals or an intermediate dev polishing your skills, this post is packed with examples and clear explanations to make Arrays second nature. 💪 📄 Download the full PDF below and start mastering one of the most powerful parts of JavaScript today. #JavaScript #FrontendDevelopment #WebDevelopment #Coding #Learning #Arrays #JSDeveloper
To view or add a comment, sign in
-
🚀 Master JavaScript Arrays — From Basics to Advanced! Arrays are the backbone of data manipulation in JavaScript — from handling lists of items to building complex data structures. 📊 This guide covers everything you need to know — ✅ Creating, accessing, and modifying arrays ✅ Copying & cloning techniques (mutable vs. immutable) ✅ Modern methods like toReversed(), toSorted(), toSpliced(), and with() ✅ Deep dive into static & iterator methods (map, filter, reduce, find, flatMap, and more) ✅ Practical exercises and real-world challenges Whether you’re a beginner brushing up your fundamentals or an intermediate dev polishing your skills, this post is packed with examples and clear explanations to make Arrays second nature. 💪 📄 Download the full PDF below and start mastering one of the most powerful parts of JavaScript today. #JavaScript #FrontendDevelopment #WebDevelopment #Coding #Learning #Arrays #JSDeveloper
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development