Day 5 of #30DaysOfJavaScript: Creating My Own Filter Function from Scratch! 🎯 Today, I tackled a great exercise that challenged me to build a custom filter function without using JavaScript’s built-in .filter() method. This involved iterating over an array and using a callback function to decide which elements to keep based on truthy values. Here’s a peek at the solution I wrote: Key takeaways from this challenge: Deepened my understanding of higher-order functions and callback usage. Learned how to evaluate truthy and false values in JavaScript more effectively. Gained appreciation for the power and convenience of built-in array methods by implementing one manually. This hands-on approach is helping me grasp fundamental JavaScript concepts in detail while preparing for real-world coding challenges. Excited to keep growing and solving more problems along the way! Let’s connect and share knowledge. #JavaScript #CodingChallenge #WebDevelopment #LeetCode #ArrayMethods #LearningByBuilding #DeveloperJourney
Creating a Custom Filter Function in JavaScript
More Relevant Posts
-
Day 8 of #30DaysOfJavaScript: Counting Function Arguments with Rest Parameters! 🎯 Solved an interesting and fundamental problem today—writing a function that returns the count of arguments passed to it. This challenge sharpened my understanding of JavaScript’s rest parameters and how they simplify working with variable numbers of arguments. Here’s my solution: javascript var argumentsLength = function(...args) { return args.length; }; Key insights gained: rest parameters allow capturing an indefinite number of arguments in an array-like structure. This approach is cleaner and more intuitive than using the legacy arguments object. Mastering these basics is essential for writing flexible, reusable functions in JavaScript. Excited to keep progressing on this learning journey and uncovering more of JavaScript’s powerful features every day! If you’re also working through JavaScript fundamentals or coding challenges, let’s connect and share tips. #JavaScript #RestParameters #CodingChallenge #LeetCode #WebDev #LearningByDoing #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 2 of My 30 Days of JavaScript Journey ✅ Challenge: Counter Function (LeetCode #2620) Create a function createCounter(n) that returns another function. Each time the returned function is called, it should return the current value of n and then increment it by 1 — producing outputs like (n, n+1, n+2, ...). 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/gczTUyQ4 💡 Solution: https://lnkd.in/g2VVnv8u 🧠 Concept Highlighted: This problem reinforces the concept of closures — how JavaScript functions can "remember" variables from their outer scope even after the outer function has finished executing. It’s a foundational concept for mastering state management and functional programming in JS. 📘 My Takeaway: A small problem, but a powerful reminder that closures are at the heart of JavaScript. Understanding how functions preserve state paves the way for writing more efficient and modular code. Step by step, the logic becomes clearer! 💪 #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #LearningEveryday #Closures
To view or add a comment, sign in
-
🧠 JavaScript Concepts I Explored Today Today was a solid learning session — I spent time understanding how functions actually shape the logic in JavaScript. Here’s what I went through 👇 Functions and how they make code reusable First-class and higher-order functions (functions inside functions 🔁) Closures — the part where JS “remembers” variables even after execution IIFE — functions that run instantly (good for isolated scopes) Arrays — map, filter, reduce, forEach Objects — destructuring, looping, optional chaining These concepts connected so many dots for me. The more I write JavaScript, the more I realize how expressive it can be when you actually understand the “why” behind the syntax. #JavaScript #CodingJourney #WebDevelopment #Frontend #MERNStack
To view or add a comment, sign in
-
The JavaScript Event Loop — The Hidden Multitasking Hero If JavaScript is single-threaded, how does it look like it’s doing so many things at once? 🤔 Meet the Event Loop — the patient snake 🐍 that makes everything flow smoothly. 🧩 In simple words: JS runs one thing at a time (main thread). When async tasks finish, the Event Loop decides when to bring them back into action — like a patient teacher calling students one by one from different queues 😄 ✨ Takeaway: --> Promises (microtasks) always run before setTimeout (macrotasks). --> JS isn’t truly “multi-threaded” — it’s just a great illusionist. 🎩 Next up → 🧠 “this” Keyword — The Most Confused Owl in JavaScript 🦉 #JavaScript #EventLoop #AsyncJS #WebDevelopment #FrontendDevelopment #CodingCommunity #100DaysOfCode #LearnToCode #MERNStack #ProgrammingHumor
To view or add a comment, sign in
-
-
🚀 Day 1 of My 30 Days of JavaScript Challenge 🧩 Problem: Create Hello World Function (LeetCode #2667) Write a function createHelloWorld that returns a new function which always returns "Hello World", no matter what arguments are passed. 💻 Language: JavaScript ❓ Question: https://lnkd.in/eVgQ9W87 💡Solution:https://lnkd.in/ed7AXEYr 🧠 Concept Used: JavaScript closures and higher-order functions Demonstrates how a function can return another function 📚 Takeaway: A simple yet powerful reminder that understanding function behavior and scope is key in JavaScript. Every small step builds stronger fundamentals! #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #100DaysOfCode
To view or add a comment, sign in
-
🔄 Day 163 of #200DaysOfCode After exploring advanced topics in JavaScript, I decided to slow down and revisit one of the most timeless logic challenges — reversing an array without using the built-in reverse() method. 🌱 It might seem like a simple exercise, but it teaches you something very powerful — how data moves in memory, how to swap values efficiently, and how small logic patterns build the foundation for solving complex problems later on. In JavaScript, it’s easy to rely on built-in functions, but when you write logic manually, you begin to understand the real mechanics behind how things work — and that’s what makes you a stronger developer. 💡 Problems like these remind me that mastery isn’t about how many advanced concepts you know, but how deeply you understand the basics. 🔁 Even experienced developers revisit their roots from time to time — because fundamentals never go out of style. Keep learning. Keep building. Keep evolving. #JavaScript #CodingChallenge #BackToBasics #163DaysOfCode #LearnInPublic #WebDevelopment #DeveloperMindset #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 4 of My 30 Days of JavaScript Journey ✅ Challenge: Create Counter Object (LeetCode #2665) Write a function createCounter(init) that returns an object with three functions: increment() → increases the value by 1 and returns it. decrement() → decreases the value by 1 and returns it. reset() → resets the value to the initial value and returns it. 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/gKxPxb8Y 💡 Solution: https://lnkd.in/g3jv6Nfi 🧠 Concept Highlighted: This challenge strengthens understanding of closures and object methods in JavaScript. It shows how functions can preserve and modify internal state — a key concept in building dynamic, stateful applications. #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #LearningEveryday #Closures #ProblemSolving
To view or add a comment, sign in
-
🔄 Day 164 of #200DaysOfCode Today, I revisited another classic JavaScript problem — removing duplicates from an array without using Set() or advanced methods. 💡 While there are modern one-liners that can handle this task in seconds, manually writing the logic helps build a deeper understanding of how arrays, loops, and conditions work together. This small challenge reinforced two key lessons: 1️⃣ Efficiency matters — Writing logic by hand makes you think about time complexity and performance. 2️⃣ Simplicity is strength — The most effective solutions are often the ones built from fundamental principles. 🔁 As developers, it’s not just about knowing shortcuts — it’s about understanding the why behind every concept. Revisiting such basic problems sharpens logical thinking and improves our ability to write cleaner, more optimized code. 🌱 Mastering the basics is not a step backward — it’s the foundation for everything advanced. #JavaScript #CodingChallenge #BackToBasics #164DaysOfCode #LearnInPublic #DeveloperMindset #WebDevelopment #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
Leveling up my front-end fundamentals one small project at a time! 🚀 Here’s a look at my Background Colour Changer — a quick video that captures the simplicity and power of event listeners and manipulating the Document Object Model (DOM) in JavaScript. Small projects like this are crucial for reinforcing core concepts before diving into larger frameworks. What's the best small project you've built to practice a core skill? Let me know! #CodingJourney #JavaScript #CSS #WebDev #LearningToCode
To view or add a comment, sign in
-
💡 Understanding Object Methods in JavaScript Working with objects is fundamental in JS. Here's a quick overview of some powerful methods: Object.keys(obj) → Returns all keys of the object. Object.values(obj) → Returns all values of the object. Object.entries(obj) → Returns key-value pairs as arrays. obj.hasOwnProperty("property") → Checks if the object has a specific property. Object.assign({}, obj, { newProperty: "newValue" }) → Creates a new object by merging existing ones. 👉 View the full example on GitHub: https://lnkd.in/dDN-vDkD #JavaScript #FullStack #100xDevs #WebDevelopment #Coding #JSConcepts #LearnJavaScript
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