30 Days JavaScript Challenge : Day 26 ✅ Today’s problem was about flattening a multi-dimensional array, but with a twist we were given a depth n and had to flatten only up to that level. Not a full flatten, not a shallow one… somewhere in between. It really makes you think about recursion and depth control: When to go deeper When to stop How to keep track of current depth What I liked is how this problem builds intuition around nested data structures something you see a lot in real apps (APIs, configs, UI trees, etc.). Slowly getting more comfortable with recursion and thinking in layers. #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
Flatten Multi-Dimensional Array with Depth Control
More Relevant Posts
-
30 Days JavaScript Challenge : Day 27 ✅ Today’s problem was about creating a compact object basically removing all falsy values from an object or array, even if they are nested. At first glance it looks easy, but once nested structures come in, it gets interesting. This problem really tests your understanding of: Falsy values (null, 0, false, "", etc.) Recursion for nested objects/arrays Treating arrays like objects (since indices are keys) It’s one of those questions that feels very practical like cleaning API responses or filtering unwanted data before using it. Definitely helped me think more deeply about how JavaScript handles data structures. Almost at the end now… consistency paying off 🚀 #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge: Day 23 ✅ Today’s problem was about building our own version of groupBy() something that’s actually super useful in real projects. The idea was simple: Take an array, run a function on each element, and group elements based on the key that function returns. What I liked about this one is how it makes you think about data transformation not just looping, but structuring data in a cleaner and more usable way. Something like: Group users by id Split numbers based on a condition Organize data for UI rendering All of this becomes much easier once you understand this pattern. Another small step, but feels like I’m getting better at writing cleaner and more practical JavaScript. #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge: Day 25 ✅ Today’s problem was about merging two arrays of objects based on a common key (id). Sounds simple at first, but it had a few interesting parts: Handling unique ids Merging objects when ids match Making sure values from the second array override the first Keeping everything sorted It’s actually very close to real-world scenarios like combining data from two APIs or updating existing records with new data. Problems like this make you think more about data handling and structure, not just loops and conditions. Day by day, things are starting to connect better. 🚀 #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic #JavaScriptMastery
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge : Day 20 ✅ Today’s problem was about checking whether a given object or array is empty. At first glance, it looks very simply, but it makes you think about how data structures actually store values whether it’s checking keys in an object or elements in an array. Also tried to think about how this can be done efficiently, even aiming for O(1) time complexity. Problems like these remind me that even basic concepts can have deeper layers when you try to implement them properly. 20 days in consistency is building up, one problem at a time. 💻🚀 #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge : Day 24 ✅ Today’s problem was about sorting an array using a custom function. Instead of directly sorting values, we use a function fn to decide the order — basically telling JavaScript how to compare elements. At first it feels simple, but it actually shows how powerful sorting can be when you control the logic: Sorting objects based on a property Sorting nested arrays Custom ranking based on conditions It’s one of those concepts that looks basic but is used everywhere in real projects. Slowly getting more clarity on how to write flexible and reusable logic in JavaScript. #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
Struggling to understand JavaScript array methods? 🤔 I used to memorize them… but it never worked. So I tried something different 👇 I started visualizing them. Now it’s much easier: • map() → transforms data • filter() → selects data • find() → gets first match • findIndex() → finds position • push() → adds item at end • pop() → removes last item • shift() → removes first item • unshift() → adds item at start Also learned an important concept: 👉 Some methods create a new array 👉 Some modify the original array This small shift made a big difference in my learning 🚀 Which method do you use the most? 👇 #JavaScript #WebDevelopment #FrontendDeveloper #Coding #LearnInPublic #100DaysOfCode #Programming #WebDev #SoftwareEngineering #Developers #Tech #CodingJourney #CodeNewbie #DevCommunity
To view or add a comment, sign in
-
-
Today's DevTips is about a way of not allowing a number to go below 0 in a React counter through using math.max. where zero is the first argument. whenever it goes below minus one it will remain always to be the maximum number which is zero, achieving the intended effect. #http #devtips #status #webdeveloper #frontendwebdeveloper #backenddeveloper #programming #program #coding #code #webdev #programmer #java #python #javascript #computers #developer #chatgpt #codinglife #stackoverflow #dev #tech #frontend #frontenddeveloper #tinyweb #frontenddev #frontendengineer #webdevelopment #webdesigner #webdev #web #technologyforgood #techie #linkedin #linkedincommunity #html #css #javascript #tips #tipsandtricks #helpfultips #insights #insightful #help #buildinpublic #buildinginpublic
To view or add a comment, sign in
-
📒 Just documented JavaScript Data Types in a clean handwritten format! Concepts feel much easier when you write and visualize them instead of just reading 📖✍️ Covered: ✔️ Primitive Types ✔️ Reference Types ✔️ Special Concepts like "typeof" & Dynamic Typing JavaScript is simple… but its behavior makes it powerful (and sometimes tricky 😄) Consistency in learning > speed 🚀 If you're learning JavaScript, start from the basics — they matter more than you think. 💬 What topic should I cover next? #JavaScript #WebDevelopment #CodingJourney #LearnToCode #Frontend #Programming #Developers #100DaysOfCode #Tech #CodeNewbie
To view or add a comment, sign in
-
-
Closures look confusing at first, but the core idea is simple: A closure is when a function remembers variables from the scope where it was created, even after that outer function has finished running. That is why closures are so useful for private state, counters, factories, and callbacks. The infographic breaks it down visually: create a variable, return an inner function, and that inner function keeps access to the remembered value. If you understand this, a lot of JavaScript starts making more sense. What JavaScript concept should I simplify next? #JavaScript #Closures #WebDevelopment #FrontendDevelopment #Programming #LearnToCode #ReactJS #SoftwareEngineering
To view or add a comment, sign in
-
-
Understanding React Hooks is a game-changer for writing clean and efficient code. Here’s a quick breakdown 👇 👉 useState Used to manage component state Triggers re-render when data changes 👉 useEffect Handles side effects like API calls, subscriptions, DOM updates Runs after render 👉 useMemo Optimizes performance by memoizing values Avoids unnecessary recalculations Visit :~ https://allconverthub.com/ 💡 Simple way to remember: useState → Store data useEffect → Run side effects useMemo → Optimize performance 🔥 Writing better React code is not about using more hooks… It’s about using the right hook at the right time. 💬Which React Hook do you use the most? #ReactJS #FrontendDeveloper #WebDevelopment #JavaScript #ReactHooks #useState #useEffect #useMemo #Coding #Programming #WebDev #UIDeveloper #SoftwareDevelopment #LearnInPublic #TechContent
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