🚀 Day 22 - Poll answer & Explanation const map = new Map(); map.set("a", 1); map.set("b", 2); const set = new Set([1, 2, 3, 3]); console.log(map.size, set.size); 2 3 Explanation (simple & clear): - Map stores key-value pairs → "a" and "b" → size = 2 - Set stores only unique values → duplicates removed - [1, 2, 3, 3] → becomes [1, 2, 3] → size = 3 Key Point: - Map counts unique keys - Set automatically removes duplicate values Output: 2 3 #JavaScript #JSInterview #FrontendDevelopment #WebDevelopment #CodingChallenge #JSConcepts #Developers #Programming #TechInterview #LearnJavaScript #100DaysOfCode #CodeNewbie #SoftwareDevelopment #CodingTips #JSBasics #DevelopersLife
Yogesh B C’s Post
More Relevant Posts
-
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 Sets, Maps, and Objects in JavaScript: When and How to Use Each Learn the differences between JavaScript's Set, Map, and plain Object data structures, their performance characteristics, and real‑world use cases. This tutorial walks you through practical examples, best practices, and guidelines for choosing the right structure for your code. Read the full article 👇 https://lnkd.in/gpUYsFux #JavaScript #WebDevelopment #Programming #Tech #Coding #JavaScriptSet #JavaScriptMap #DataStructures #FrontendDevelopment #JSBestPractices #DigitalTransformation #FutureOfWork
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge: Day 18 ✅ Today’s problem was about implementing a debounce function. The idea is simple but very useful delay the execution of a function, and if it gets called again within that delay, cancel the previous call and restart the timer. This concept is widely used in real-world scenarios like: • search input optimization • reducing unnecessary API calls • handling rapid user events It was a great exercise to understand how timers and function control work together in JavaScript. 18 days in getting more comfortable with concepts that are actually used in real applications. 💻🚀 #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
🚀 Day 25 - Poll answer & Explanation console.log([].length); // 0 console.log([,,,].length); // 3 Explanation: [] → empty array → no elements → length = 0 [,,,] → 3 empty slots (not values, just positions) JavaScript counts slots, not actual values → length = 3 #JavaScript #JSTricks #JSBasics #JSInterview #FrontendDev #WebDevelopment #Coding #Programming #Developer #CodeNewbie #LearnToCode #TrickyQuestions #InterviewPrep #DevTips #JavaScriptTips
To view or add a comment, sign in
-
Why does the loading spinner sometimes never stop? No errors. No crash. Just spinning. It looks like a UI issue. But most of the time, it’s not. It’s an error handling problem. I wrote a simple breakdown of why this happens and how to fix it. Read here: https://lnkd.in/gPvF_iK7 #JavaScript #Frontend #Programming #WebDevelopment #SoftwareEngineering
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
-
-
The "this" Keyword: Predictable or a Trap? 🧐 Most devs think they understand this, until it returns undefined. Can you guess the output of this simple object? const obj = { a: 10, f: function () { return this.a; }, }; console.log(obj.f()); The answer seems easy... but do you know what happens to this if we change that function to an Arrow Function? 🤯 In my latest video, I break down exactly how execution context works so you never have to guess again. #JavaScript #WebDev #CodingTips #SoftwareEngineering #Programming
To view or add a comment, sign in
-
In JavaScript, Reference Data Types say: “If you change me… I will change the every refrences of yours. 😏 Sounds dramatic? Look at this 👇 let a = [1, 2, 3, 4]; let b = a; b.pop(); console.log(a); console.log(b); comment down the output?? #javascript #coding #learntocode #programming #datatypes #learninginpublic
To view or add a comment, sign in
-
Ever wondered why JavaScript shows “undefined” even before a variable is assigned? 🤯 console.log(a); var a = 10; At first glance, this feels confusing… But the answer lies in one powerful concept: 👉 Execution Context Here’s what actually happens behind the scenes: ⚡ When JavaScript runs your code, it creates an Execution Context ⚡ In the memory phase, variables are hoisted → initialized as undefined ⚡ In the execution phase, code runs line by line and values get assigned I made a short video explaining the basics—would love your feedback 🙌 #javascript #webdevelopment #frontend #programming #coding #developers #learntocode #100daysofcode
To view or add a comment, sign in
-
JavaScript array methods visualized with Pokémon. I’ve been experimenting with short visual loops using Claude Code and Remotion to explain concepts faster and this one shows some of the most common array methods in practice. Quick reference using real behavior: • filter() selects matching items • map() transforms items • find() returns the first match • findIndex() returns the index of the match • fill() replaces values • every() checks all items • some() checks at least one • concat() merges arrays • includes() checks existence • push() adds to the end • pop() removes from the end • shift() removes from the start • unshift() adds to the start • splice() removes or replaces items Same concepts, just easier to visualize. #javascript #webdev #frontend #coding #programming
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