By han, 14 September, 2022

A Rat was traveling along the King's highway. He was a very proud Rat, considering his small size and the bad reputation all Rats have. As Mr.

Rat walked along—he kept mostly to the ditch—he noticed a great commotion up the road, and soon a grand procession came in view. It was the King and his retinue.

By han, 14 September, 2022

Long ago, the mice had a general council to consider what measures they could take to outwit their common enemy, the Cat.

Some said this, and some said that; but at last a young mouse got up and said he had a proposal to make, which he thought would meet the case.

By han, 7 September, 2022
Interfaces

An interface is similar to an abstract class; indeed interfaces occupy the same namespace as classes and abstract classes. For that reason, you cannot define an interface with the same name as a class. An interface is a fully abstract class; none of its methods are implemented and instead of a class sub-classing from it, it is said to implement that interface.

By han, 1 September, 2022

Component Lifecycle

The three phases are: mounted, updated, and unmounted.

Each Vue component instance goes through a series of initialization steps when it's created - for example, it needs to set up data observation, compile the template, mount the instance to the DOM, and update the DOM when data changes. Along the way, it also runs functions called lifecycle hooks, giving users the opportunity to add their own code at specific stages.

By han, 1 September, 2022
Lifecycle of Components

The react lifecycle method is used in the React class component. It helps us in creating our state and mutating them.
Each component in React has a lifecycle which you can monitor and manipulate during its three main phases.

The three phases are: Mounting, Updating, and Unmounting.

By han, 30 August, 2022

In JavaScript, standard built-in object-copy operations (spread syntax, Array.prototype.concat(), Array.prototype.slice(), Array.from(), Object.assign(), and Object.create()) do not create deep copies (instead, they create shallow copies).

A deep copy of an object is a copy whose properties do not share the same references (point to the same underlying values) as those of the source object from which the copy was made.

By han, 30 August, 2022

A shallow copy of an object is a copy whose properties share the same references (point to the same underlying values) as those of the source object from which the copy was made.

As a result, when you change either the source or the copy, you may also cause the other object to change too — and so, you may end up unintentionally causing changes to the source or copy that you don't expect.

That behavior contrasts with the behavior of a deep copy, in which the source and copy are completely independent.

By han, 30 August, 2022

Currying is an advanced technique of working with functions. It’s used not only in JavaScript, but in other languages as well.

Currying is a transformation of functions that translates a function from callable as f(a, b, c) into callable as f(a)(b)(c).

Currying doesn’t call a function. It just transforms it.

Let’s see an example first, to better understand what we’re talking about, and then practical applications.