Sometime you might ask yourself that why JavaScript came up with let and const in ES6, although var is already there. I will answer it at the end. There are many benefits of using let and const over var. I will not go through all of these.

To understand the temporal dead zone in a simple words, please go through my blog, “Let, const and Temporal dead zone” .


The user interface frameworks and libraries of Javascript programming
language work in a cycle. After every six months, they change positions
and a new one pops up. From past four years I am using react.js. It is an UI library backed by facebook. …


In this blog we are going to talk about the usage of these higher order functions.

  1. Map
  2. forEach

I always getting asked about the usage of these function by my colleagues and friends. Sometime we get confused while using these functions to do some operations on the array. We have…


You might have faced situations where you needed to create JavaScript object on basis of some condition. I had such situations where I needed to create user object and add a flag “isVerified”: true if the user’s email is verified.

To know more about it please check my blog.


Source: Google Image search

Javascript has it’s own way of dealing with values. Developers from Java or any object oriented programming background get confused while dealing with falsy values. That may leads to some mistakes. Let’s try to understand, what is the meaning of falsy values in Javascript.

To read complete blog, please visit my website.


Image Source: Google

If you are using ES6(es2015) then you might have knowledge on spread operator.

I am going to share my experience, and problems I faced while using it with object. We will see how this spread operator works.

Case 1:

Using spread operator and Object.assign is one way of practicing immutability…


Image source: Google

Most hard working and smart guys are working for ReactJS library. I can say, they have better understanding of real time problems with UI. That’s why people see reactjs as a solution and use it to make complicated UIs. Reactjs trying to make things easy for both developers and end…


diagram of modern React lifecycle methods for react 16.3 by Dan Abramov

This diagram is not valid for React v16.4.

In React 16.3, new component life-cycles has been introduced. As per reactjs official doc, these life-cycle methods are replacing existing ones.

New life-cycle methods are:

  • static getDerivedStateFromProps()
  • getSnapshotBeforeUpdate()

Deprecated methods are:

  • componentWillMount became, UNSAFE_componentWillMount
  • componentWillReceiveProps became, UNSAFE_componentWillReceiveProps
  • componentWillUpdate became, UNSAFE_componentWillUpdate

These deprecated…


Image source: http://www.fortressofsolitude.co.za

Yeah, react 16.3 has come up with it’s new Context API which is more powerful.

You can go through the official documentation.

We have to use following APIs to get real taste of “NEW CONTEXT API”.

  • React.createContext
  • Provider
  • Consumer

To create the context we need use it’s first API.


I will discuss the problems about context API of react version less than 16.3 .

Let’s checkout a simple app which displays date and time.

Here, we have the following components.

  • App
  • DateTimeDisplay
  • MyClock

App.jsx

class App extends React.Component {
constructor(props) {
super(props);
}…

Gobinda Thakur

Fullstack web developer, www.gobindathakur.com

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