Learn the concept of inheritance with the prototype chain

Originally posted at my personal blog debuggr.io

In this article we will learn about JavaScript’s prototype chain. We will see how objects connect to other objects and how we can implement “inheritance” and relationships between these objects.

Our Goal

As developers, our main task when we write code is usually to manipulate data. We get the data and store it some where, then we run functionality on that data. Wouldn’t it be nice to have the functionality and the relevant data bundled together on the same place? this would make it a lot easier for us.

Imagine a object:

What…


The bug that you don’t even know you have

Originally posted on my personal blog debugger.io

If your application is depended on a state that gets updated asynchronously, there is a good chance you have a bug. The bad news is that its hard or even almost impossible to reproduce in production. The good news is that you now know about it and we will learn how to reproduce it and fix it.

In this article I will use a demo application that I used in a previous article React state update on an unmounted component. …


90% of react developers faced this warning at least once

Originally posted on my personal blog debugger.io

If you are a react developer, there is a good chance that you faced this warning at least once:

Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

In order to understand how to fix this warning, we need to understand why it is happening. We will need to reproduce it in a consistent way.

⚠️ Note that in this article i use react hooks…


Follow these 5 rules to determine what “this” is bound to

Originally posted on my personal blog debuggr.io

In this article we will learn how to identify and recognize what refers to in a given context and we will explore what rules and conditions are taken under consideration by the engine to determine the reference of the key word.

The challenge

One of the most challenging concepts in JavaScript is the key word, maybe because it is so different than other languages or maybe because the rules to determine it’s value are not that clear.

Lets quote a paragraph from MDN:

In most cases, the value of this is determined…


~8 reasons why you should answer StackOverflow questions

Originally posted on my personal blog debuggr.io

The StackOverflow Logo

Why should I bother?

Why should we bother ourselves to try and solve other people’s challenges? We have our own challenges and sometimes are up against a tight deadline. I’m often asked this by friends and peers, so here is a list I made of the reasons that motivate me to answer StackOverflow questions (not in a particular order):

The Motivation List

- Points, Credit, Prestige
- Kindness, giving back to the community
- Gain experience with real world challenges
- Keep up with the race and stay ahead of the game
- Learning new things “by mistake”
- Improve tech communication skills
- Improve…


Allow a react application to be part of a micro frontends architecture

Originally posted on my personal blog debuggr.io

This is a followup article for this tweet

This may address only specific use cases, like already existing applications or mini applications that you can’t or won’t rewrite, or stand-alone application which you need to provide to others to implement on their websites and you want to provide an API to interact with your application.

In this article / tutorial we will build a very basic react “widget” (a Counter!) and a very basic react application. we will see what problems we face when we try to interact with the two applications…


JavaScript equality code example

The truth behind the double and triple equal in JavaScript

Originally posted on my personal blog debuggr.io

Some of the most frequently-asked interview questions of Front-End are about Equality comparisons and sameness in JavaScript (ECMAScript).

And the queen of these questions is:

What is the difference between the “double equals” and the “triple equals”?

Well, we all know the answer for that. The triple equal checks for types while the double equal isn’t.

That could be a short and nice answer for this question but unfortunately it is FALSE.

As per the specs, 7.2.14 Abstract Equality Comparison you can clearly see at the first check:

If Type(x) is the same…


Can not be compared

Can we really compare react’s context with redux?

Well, do not let the title mislead you, it is only meant to lure you in :)
Redux is not dead. on the contrary it is very alive and is far from being irrelevant.

Originally posted on my personal blog debuggr.io

So what are you doing here?

This post is meant to be a “counter attack” against all of the blog-posts / articles / tutorials / tweets / stories that sprang up like mushrooms after the rain when react v16.3 released and the announce about the New Context API.
And shockingly this is not a passing trend, people still write and post about this match-up.

Posts…

Sagiv Ben Giat

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store