🚀 Day 6 of My 30 Days of JavaScript Challenge 🧩 Problem: Filter Elements from Array (LeetCode #2634) Given an integer array arr and a filtering function fn, return a new array filteredArr that only includes elements where fn(arr[i], i) returns a truthy value. Solve this without using the built-in Array.filter() method. 💻 Language: JavaScript ❓ Question: https://lnkd.in/eSGpgXcM 💡 Solution: https://lnkd.in/ekA6y-u3 🧠 Concepts Used: Higher-order functions and callbacks Conditional checks for truthy/falsy values Understanding Boolean(value) behavior in JavaScript 📚 Takeaway: Rebuilding filter() from scratch deepens understanding of conditional logic, iteration, and truthy/falsy evaluation — all essential for functional programming in JavaScript. #Day6 #JavaScript #30DaysOfCode #LeetCode #CodingChallenge #WebDevelopment #FrontendDevelopment #100DaysOfCode
"Rebuilding JavaScript filter() without Array.filter() method"
More Relevant Posts
-
🚀 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 5 of My 30 Days of JavaScript Challenge 🧩 Problem: Apply Transform Over Each Element in Array (LeetCode #2635) Given an integer array arr and a mapping function fn, return a new array such that: newArray[i] = fn(arr[i], i) Solve this without using the built-in Array.map() method. 💻 Language: JavaScript ❓ Question: https://lnkd.in/eq8qYfpb 💡 Solution: https://lnkd.in/eT5U2kBp 🧠 Concepts Used: Higher-order functions (passing functions as arguments) Loops and callback functions Core idea behind how .map() works internally 📚 Takeaway: By recreating the Array.map() method manually, I learned how callback execution and array transformations work under the hood — a must-know for mastering JavaScript fundamentals. #Day5 #JavaScript #30DaysOfCode #LeetCode #CodingChallenge #WebDevelopment #FrontendDevelopment #100DaysOfCode
To view or add a comment, sign in
-
“Daily Temperatures” Using Stack in JavaScript ♨️ 👉 Day 19 / Day 93 👈 Description: 👉 The goal is to find out how many days you have to wait until a warmer temperature. ✅ Approach: 👉 Traverse the array from right to left. 👉Maintain a stack to store indices of temperatures in decreasing order. 👉 For each day, pop all smaller or equal temperatures. 👉 The difference between the current index and top of stack gives the number of days to wait. This method ensures O(n) time complexity instead of a brute-force O(n²). #JavaScript #CodingChallenge #DSA #InterviewPreparation #FrontendDeveloper #ProblemSolving #100DaysOfCode #TechLearning #LeetCode #Algorithms
To view or add a comment, sign in
-
-
🚀 Day 4 of My 30 Days of JavaScript Challenge 🧩 Problem: Create Counter II (LeetCode #2665) Write a function createCounter(init) that returns an object with three functions: increment() → increases the current value by 1 and returns it decrement() → decreases the current value by 1 and returns it reset() → resets the value back to init and returns it 💻 Language: JavaScript ❓ Question: https://lnkd.in/eupkr-a3 💡 Solution: https://lnkd.in/eq3BEsn2 🧠 Concepts Used: Closures for maintaining private state across function calls Object methods to encapsulate multiple related actions State management inside functions 📚 Takeaway: This challenge reinforces closures and encapsulation — two powerful ideas that make JavaScript functions behave like real objects with memory and behavior. #Day4 #JavaScript #30DaysOfCode #LeetCode #CodingChallenge #WebDevelopment #FrontendDevelopment #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 10 of My 30 Days of JavaScript Challenge 🧩 Problem: Allow One Function Call (LeetCode #2666) Given a function fn, return a new function that ensures fn can only be called once. The first call returns the actual result, and every subsequent call returns undefined. 💻 Language: JavaScript 📖 Problem Link: https://lnkd.in/epnrfahZ 💡 Solution: https://lnkd.in/eGQKWkEk 🧠 Concepts Used Closures to store state (whether function is already called) Function Wrapping Higher-Order Functions 📚 Takeaway This problem is a great example of how closures preserve state between function calls — an essential concept for: Memoization API rate-limiting Event listener control #Day10 #JavaScript #30DaysOfCode #LeetCode #WebDevelopment #CodingChallenge #Closures #FrontendDevelopment #100DaysOfCode
To view or add a comment, sign in
-
💻✨ Practicing JavaScript Arrays! Today, I explored one of the most important topics in JavaScript — Arrays. From creating arrays to applying methods like push(), pop(), shift(), unshift(), map(), and filter(), I learned how powerful arrays can be in managing and manipulating data efficiently. 🧠 Key Concepts I practiced: Creating and accessing array elements Iterating through arrays using loops Using built-in methods for transformation Understanding how arrays make data handling easier in JavaScript Every small step in coding adds up to big progress! 🚀 #JavaScript #WebDevelopment #CodingJourney #LearningByDoing #FrontendDevelopment #JSArrays #WomenInTech #PracticeAndProgress
To view or add a comment, sign in
-
-
🚀 Day 8 of My 30 Days of JavaScript Journey ✅ Challenge: Function Composition (LeetCode #2629) Build a function compose(functions) that returns a new function representing the composition of all given functions. When called with an input x, it evaluates from right to left, applying each function in sequence. If no functions are provided, it returns the identity function — meaning f(x) = x. 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/gEXnFK4d 💡 Solution: https://lnkd.in/gjKcFQvB 🧠 Concept Highlighted: This challenge explores function composition, a key concept in functional programming, showing how multiple simple functions can combine to form powerful transformations. It reinforces the importance of execution order and function chaining in JavaScript. #Day8 #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #FunctionalProgramming #LearningEveryday #ProblemSolving
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
-
🚀 Starting My JavaScript Revision Journey! Body: Yesterday, I went back to the basics of JavaScript to strengthen my foundation. Here’s what I revised: 🟡 Variables — var, let, and const and when to use them 🟡 Scope — Global variables (accessible everywhere) — Local variables (accessible within a function/block) 🟡 Data Types — Primitive: string, number, boolean, null, undefined, symbol, bigint — Non-Primitive: objects, arrays, functions It’s amazing how revisiting fundamentals clears a lot of confusion! What JavaScript concept took you time to understand when starting out? #JavaScript #BackendDevelopment #LearningJourney #Coding
To view or add a comment, sign in
-
🚀 JavaScript Revision Series — Day 3 Today’s revision was all about Operators in JavaScript — the tools that let us do everything from math to logic in our programs! 💻✨ 🟢 Operators Covered: Arithmetic: + - * / % Assignment: =, +=, -=, *= Logical: &&, ||, ! Ternary Operator: condition ? true : false 😄 Fun JS Moment: Remember, 5 + "1" = "51" But 5 - "1" = 4 JS loves to play tricks with operators 😅 --- 🔗 Daily Practice Repo: https://lnkd.in/ejQk84Zg Step by step, one operator at a time — building solid JS foundations! 🚀 #JavaScript #JavaScriptBasics #LearningJourney #WebDevelopment #FrontendDevelopment #CodingJourney #MERNStack #ConsistencyIsKey #SMIT #DeveloperCommunity #Saylani
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