Day 9 of #30DaysOfJavaScript on LeetCode Today's challenge: 2703 — Return Length of Arguments Passed The task was to write a function that returns the number of arguments passed to it — a simple yet elegant problem to explore rest parameters in JavaScript. Here’s my solution 👇 var argumentsLength = function(...args) { return args.length; }; It’s a short problem but a great reminder that even small concepts like this are essential for mastering function flexibility in JavaScript! Try it out here : https://lnkd.in/g6WC5mu7 #JavaScript #LeetCode #CodingChallenge #LearningJourney #30DaysOfCode #Functions #RestParameters #Programming
"Mastering JavaScript with LeetCode: Return Length of Arguments"
More Relevant Posts
-
Day 6 of #30DaysOfJavaScript on LeetCode Today's challenge: 2634 — Filter Elements from Array The task was to implement a custom filter function that returns a new array containing only the elements that satisfy a given condition — similar to the built-in Array.filter() method, but without using it. Here’s my solution 👇 var filter = function(arr, fn) { let ans = []; for (let i = 0; i < arr.length; i++) { if (fn(arr[i], i)) ans.push(arr[i]); } return ans; }; This challenge was a great way to understand how callback functions and conditional logic work together in JavaScript — it really helps appreciate how built-in methods like filter() operate under the hood! If you’d like to try it out, check it here: https://lnkd.in/g6WC5mu7 #JavaScript #LeetCode #CodingChallenge #LearningJourney #30DaysOfCode #Functions #Callbacks #Arrays #Programming #Filter
To view or add a comment, sign in
-
-
#100DaysOfCode challenge by learning programming with #JavaScript and #React with #TreeHouse Day 3- learned about strings, how to take in user inputs, how to combine them with other lines of strings (string concatenation!), and ways to make the code more readable overall. I found out very quickly that it can get very messy, very easily 😅 I've run into to some issues following along with the lessons and my biggest issue is misspellings (syntax errors). I'm just glad the JavaScript console points you to which lines have an issue. It might only show you one error line at a time but it's better than nothing! It's definitely a lot to take in so I understand why it's recommended to not overwhelm yourself in the beginning and just taking it slow and one day at a time.
To view or add a comment, sign in
-
Just published a beginner-friendly guide to understanding function binding in JavaScript! If you've ever wondered why `this` becomes undefined in callbacks, this article breaks it down with simple examples. Perfect for developers learning JavaScript or anyone who needs a refresher on bind() 💻 https://lnkd.in/dmAU3Rhc #JavaScript #WebDevelopment #Programming #Coding
To view or add a comment, sign in
-
.bind(this) was one of the concepts that took time before I fully understood how it worked. And the truth is many developers who started from JavaScript still struggle with the OOP paradigm. The .bind(this) helps the method it is being called on, in this case sendEmail to remember its parent class and the properties in it. Without that, calling the sendEmail() after instanciating the parent class will return undefined. #OOP #Javascript #Programming
To view or add a comment, sign in
-
-
Every JavaScript developer has hit that confusing moment when var starts acting like it has a mind of its own 😅 I still remember spending hours debugging a scope issue… only to find out that var is function-scoped, while let and const are block-scoped. That’s exactly what we break down in our new Instagram video a quick visual guide to mastering var, let, and const, so you’ll never get caught off guard again. 📹 Check out the full video on our Instagram-> link in the comments 👇 #JavaScript #WebDevelopment #CodingTips #LearnToCode #FrontendDevelopment #Programming #TechEducation
To view or add a comment, sign in
-
If you are still struggling to understand some JavaScript trick concept of Deep and Shallow clone join me as I explore and break down how to deep and shallow clone and also how to apply them with confidence Let's discuss Deep and Shallow Clone in JavaScript jabo Landry ・ Nov 1 #webdev #javascript #programming #beginners https://lnkd.in/gYeFwW4e
To view or add a comment, sign in
-
If you are still struggling to understand some JavaScript trick concept of Deep and Shallow clone join me as I explore and break down how to deep and shallow clone and also how to apply them with confidence Let's discuss Deep and Shallow Clone in JavaScript jabo Landry ・ Nov 1 #webdev #javascript #programming #beginners https://lnkd.in/gYeFwW4e
To view or add a comment, sign in
-
🚀 Day 81 of #100DaysOfCode Today I learned how to create object literals in JavaScript. An object literal lets you store related data as key-value pairs inside curly braces. For example: const car = { brand: "Toyota", year: 2020, color: "red" }; This way, you can easily organize, access, and update complex data as one unit. Object literals are foundational for structuring real-world information in your programs. #JavaScript #ObjectLiterals #Programming #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Understanding the difference between ++i and i++ in JavaScript Ever wondered what’s the real difference between ++i and i++ in JavaScript? They both add 1 to your variable — but timing is the key. ++i increases the value before it’s used. i++ increases the value after it’s used. It’s a tiny detail that can make a big difference, especially inside loops or complex expressions. #JavaScript #Programming #CodeTips #WebDevelopment
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