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
How to count function arguments with rest parameters in JavaScript
More Relevant Posts
-
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
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 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 11 of My 30 Days of JavaScript Journey ✅ Challenge: Memoize (LeetCode #2623) The task was to create a memoize(fn) function that caches results so that repeated calls with the same inputs return instantly from cache — without re-executing the original function. This helps improve performance when dealing with expensive computations like fibonacci or factorial, and even simple operations like sum when called repeatedly. 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/gnHmbPih 💡 Solution: https://lnkd.in/gGJZjYY9 🧠 Concept Highlighted: Memoization is a powerful optimization technique that uses caching to avoid repeating calculations. It strengthens understanding of closures, function arguments handling, and performance-oriented JavaScript. #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #Memoization #PerformanceOptimization #LearningEveryday #ProblemSolving
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
-
Let's Understand JavaScript Promises If you’ve ever dealt with asynchronous code in JavaScript, you’ve probably heard of Promises. Think of a Promise like a real-life promise it can either be kept or broken. Here’s how it works 👇 • Pending: The promise is still waiting for something to finish (like fetching data). • Fulfilled (Resolved): The task succeeded! You get the result using .then(). • Rejected: Something went wrong you handle the error with .catch(). 🧠 Example: new Promise((resolve, reject) => { const success = true; success ? resolve("Data received!") : reject("Error occurred!"); }) .then(console.log) .catch(console.error); Promises make asynchronous code cleaner and easier to manage no more callback hell! 💬 How did you first learn about Promises? Drop your favorite example below! #JavaScript #WebDevelopment #AsyncProgramming #Learning #Coding
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
-
🚀 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 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
-
Problem - 2 series of — “JavaScript 0 → Hero” Every few days, I’ll post a short JavaScript problem — from the basics to advanced — to help you think like a developer 👨💻 You’ll get: 🧩 Real-world JS puzzles 🧠 Step-by-step explanations 💬 Community discussions in the comments Whether you’re just starting out or brushing up your skills, this series will help you level up one challenge at a time. 🔔 Follow me and turn on notifications to join the journey! Comment down the answer 👇 hashtag #JavaScript #CodingChallenge #WebDevelopment #Learning #trending #leetcode
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