I recently stumbled on a neat JavaScript quirk: an object can actually hide a method from its prototype just by having a property with the same name. Even then, the method itself isn’t lost! You can still call it by borrowing it from Object.prototype and explicitly setting this. It’s a small reminder of how objects in JS separate data from behavior, and how flexible prototypes really are. #JavaScript #WebDev #CodingTips #DeveloperLife #JSQuirks
JS Quirk: Hiding Methods with Properties
More Relevant Posts
-
Built a real-time validation system — part of The Odin Project's JavaScript course. ✅ Email, Country, Postal Code, Password & Confirm ✅ Live inline validation: red/green feedback as you type ✅ Multi-country postal regex ✅ Password rules: letter, number, special char ✅ Accessibility: aria-invalid, aria-describedby, aria-live ✅ No libraries — just vanilla JS, HTML, CSS If all valid... you get a high five. 🌐 Live: https://lnkd.in/e9mDU_qj 💾 Code: https://lnkd.in/ercq89FN 🎥 Watch how it works #JavaScript #WebDev #FrontEnd #TheOdinProject #LearningInPublic #FormValidation
To view or add a comment, sign in
-
Tiny JavaScript methods, massive clarity. Today’s snippet breaks down how join, substring, slice, and splice actually behave — same syntax, very different output. If you’ve ever been confused why slice doesn’t modify the array but splice does, this one is for you. Clean examples, zero fluff, straight logic. Save this for revision and share it with someone learning JavaScript fundamentals. Follow for more daily JS clarity and real interview-level concepts. #JavaScript #JSBasics #FrontendDevelopment #WebDeveloper #CodingSnippets #LearnJavaScript #DeveloperTips #ProgrammingLogic #CodeDaily
To view or add a comment, sign in
-
-
🚀 Day 885 of #900DaysOfCode ✨ 5 Important Object Methods in JavaScript Objects are at the core of JavaScript — and knowing how to work with them efficiently can make your code cleaner, more readable, and easier to maintain. In today’s post, I’ve covered 5 essential JavaScript object methods that every developer should be familiar with. These methods help you handle data more effectively and simplify common object-related operations in real-world applications. If you want to strengthen your JavaScript fundamentals and write more confident code, this post is for you. 👇 Which object method do you use most often? Let me know in the comments! #Day885 #learningoftheday #900daysofcodingchallenge #FrontendDevelopment #WebDevelopment #JavaScript #React #CodingCommunity #Objects
To view or add a comment, sign in
-
🚀 Day 880 of #900DaysOfCode ✨ Rest vs Spread Operator in JavaScript The rest and spread operators look identical in syntax, yet they solve two very different problems in JavaScript — and that’s where many developers get confused. In today’s post, I’ve clearly explained how rest and spread operators work, why they exist, and when to use each one in real-world JavaScript scenarios. The explanation is kept simple, practical, and easy to remember, so you don’t mix them up again. If you want to write cleaner functions and handle data more confidently, this post is for you. 👇 Which one confused you the most earlier — rest or spread? Let me know in the comments! #Day880 #learningoftheday #900daysofcodingchallenge #FrontendDevelopment #WebDevelopment #JavaScript #React #CodingCommunity #ES6 #FrontendDevelopment
To view or add a comment, sign in
-
`𝗳𝗼𝗿𝗘𝗮𝗰𝗵` 𝗹𝗼𝗼𝗸𝘀 𝗶𝗻𝗻𝗼𝗰𝗲𝗻𝘁. 𝗨𝗻𝘁𝗶𝗹 𝘆𝗼𝘂 𝗺𝗶𝘅 𝗶𝘁 𝘄𝗶𝘁𝗵 𝗮𝘀𝘆𝗻𝗰 𝗰𝗼𝗱𝗲. Many async bugs don’t throw errors. They just quietly do the wrong thing. `forEach` doesn’t wait. It doesn’t respect `await`. So your logic runs out of order while your code 𝗹𝗼𝗼𝗸𝘀 correct. This is one of those traps that separates “working code” from 𝗿𝗲𝗹𝗶𝗮𝗯𝗹𝗲 𝗰𝗼𝗱𝗲. If you write async JavaScript, this is worth a pause. 𝗥𝗲𝗮𝗱 𝗺𝗼𝗿𝗲: https://lnkd.in/dww_BYP2 #JavaScript #AsyncProgramming #CleanCode #WebDevelopment #DeveloperMindset
To view or add a comment, sign in
-
Day 42/100 – An Important JavaScript Concept Many People Ignore Not all performance issues come from bad code. Sometimes they come from too many function calls. 📌 Topic: Debouncing vs Throttling Both are used to control how often a function executes. ✅ Debouncing Runs the function only after a certain time has passed since the last event. Example use cases: • Search input • Form validation 👉 Executes when user stops typing. ✅ Throttling Runs the function at a fixed interval, no matter how many times the event occurs. Example use cases: • Scroll events • Window resize 👉 Executes every X milliseconds. Understanding these concepts helps build faster and smoother applications. Small improvements. Big impact. On to Day 43 🚀 #100DaysOfCode #JavaScript #WebDevelopment #LearningInPublic #Consistency #FrontendDevelopment
To view or add a comment, sign in
-
-
JavaScript Notes to Escape Tutorial Hell (14/20) JavaScript is a single-threaded language. It has one call stack and can only do one thing at a time. So, why doesn't your entire browser freeze every time you click a button or wait for a timer? The answer is the Callback Function. It handles timers, clicks, and async tasks smoothly. This deck explains: - What callback functions really are - How callbacks enable asynchronous behavior - Why setTimeout and event listeners don’t block execution - How closures maintain state (like a click counter) - How callbacks interact with the call stack - Why unmanaged event listeners can cause memory issues Callbacks are powerful, but only when you understand how they work internally. #JavaScript #WebDevelopment #Callbacks #Asynchronous #CodingJourney #SoftwareEngineering #InterviewPrep #FrontendDeveloper
To view or add a comment, sign in
-
JavaScript tip that actually matters 👇 <async/await> doesn’t make code synchronous. It only makes asynchronous code easier to reason about. The event loop, microtasks, and call stack still behave the same — which is why blocking the main thread or misusing promises can still hurt performance. Clean syntax ≠ clean execution. Understanding how JS runs is what separates reliable code from flaky code. #JavaScript #WebPerformance #FrontendEngineering #WebDev #Learning
To view or add a comment, sign in
-
JavaScript Notes to Escape Tutorial Hell (6/20) undefined is NOT the same as "empty". And it is definitely not the same as not defined. This is one of the most common interview questions, but the answer lies deep in the Memory Creation Phase. This deck explains the difference from the engine’s point of view, not just definitions. This deck explains: - Why undefined is a system-assigned placeholder - When variables get undefined during the memory creation phase - What “not defined” actually means inside the JS engine - Why JavaScript is loosely typed - Why manually assigning undefined is a bad practice Once this clicks, many runtime errors suddenly make sense. #JavaScript #WebDevelopment #Undefined #CodingJourney #SoftwareEngineering #LearningInPublic #FrontendDeveloper
To view or add a comment, sign in
-
Ever seen a JavaScript function “remember” a variable long after the outer function has finished? That behavior comes from closures — one of the most important concepts in JavaScript. In this carousel, I break down closures using the classic counter example so the idea finally clicks: How the outer function creates a variable Why the inner function still has access to it How JavaScript keeps that scope alive Why the counter keeps increasing And where closures show up in real-world code Follow CodebreakDev for more developer fundamentals and clean JavaScript explainers. #javascript #webdevelopment #softwareengineering #codingtips #learninginpublic #programmingfundamentals #frontenddevelopment #CodebreakDev
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