
Tapas Adhikary
Freelance Contributor at Freelance
- Teaching to be a Better Developer - 28K+ subs on YT: https://t.co/9FPjnpdcpG - Writer @freecodecamp - Founder @creowistech @reactplayio
Articles
-
1 week ago |
dev.to | Tapas Adhikary
What is a WeakMap? A WeakMap is like a regular Map, but with one juicy twist:Its keys must be objects, and it holds them weakly — meaning it won’t stop them from being garbage collected. Think of WeakMap as:A magic box that only an object can open and take things from it. When the object leaves, the magic box also disappears. When Should You Use WeakMap? Use WeakMap when you want to:Associate truly private data with an object. Avoid memory leaks with temporary objects.
-
2 weeks ago |
dev.to | Tapas Adhikary
Promise Chain vs. No-ChainA promise chain is formed when we append multiple promise handler functions(like, .then() or .catch()) to handle results and errors. However, at times you could be mistaken that you need to prefix the promise everytime you want to form a chain. Let's understand it with the following examples:First, here is a simple promise created with the Promise() constructor function. The promise resolves immidiately with a result value of 10.
-
2 weeks ago |
dev.to | Tapas Adhikary
In JavaScript DOM, both innerText and textContent seem to give you the text inside an HTML element. But under the hood, they work quite differently. Let’s explore what they are, how they differ, and when to use which—with real-world examples! The textContent — The Raw TexterReturns all the text in the element, including hidden elements. Ignores CSS and layout. Faster because there are no layout calculations. Great for getting raw data or sanitizing content.
-
3 weeks ago |
dev.to | Tapas Adhikary
What is Abstraction? Abstraction is an Object-Oriented Programming (OOP) principle that means hiding internal details(or complexities) and exposing only essential parts to the end users. Think of it like using a TV remote — you press a button to switch channels, but you don’t need to understand the circuitry behind it. In code, abstraction helps keep things clean, maintainable, and secure. Users interact with simple methods, while complex logic stays away. Why is Abstraction Important?
-
3 weeks ago |
dev.to | Tapas Adhikary
Ever wondered how JavaScript knows when to run your .then() block? Or why your console.log("done") appears before a resolved promise result? Let’s break it down in this quick TidBit! What is a Promise?
Try JournoFinder For Free
Search and contact over 1M+ journalist profiles, browse 100M+ articles, and unlock powerful PR tools.
Start Your 7-Day Free Trial →X (formerly Twitter)
- Followers
- 17K
- Tweets
- 11K
- DMs Open
- Yes