JavaScript
React
Best Practices
Popular
Post image

Lifecycle methods, hooks, suspense: which's best for fetching in React?

Lifecycle methods, hooks & suspense fetch data in React. The post describes them in examples and demos, distill the benefits and drawbacks of each one.
Continue reading ➞
Post image

A Simple Explanation of JavaScript Closures

A closure is a function that captures variables from where it is defined (or its lexical scope).
Continue reading ➞
Post image

Be Aware of Stale Closures when Using React Hooks

Updated January 9, 2021
The stale closures is a pitfall of React hooks when an outdated variable is captured by a closure.
Continue reading ➞
Post image

7 Simple but Tricky JavaScript Interview Questions

A compiled list of simple but tricky questions you might be asked during a JavaScript coding interview.
Continue reading ➞
Post image

When to Use Map instead of Plain JavaScript Object

Map complements plain objects. Map's main benefits over plain object is allowing keys of any type and any name.
Continue reading ➞
Post image

Don't Use JavaScript Variables Without Knowing Temporal Dead Zone

Temporal Dead Zone forbids the access of variables and classes before declaration in JavaScript.
Continue reading ➞
Post image

How to Solve Render Props Callback Hell

Posted September 24, 2019
Efficient techniques to solve the callback hell problem of React render props.
Continue reading ➞
Post image

Let's Master JavaScript Function Parameters

A detailed guide on how to use efficiently function parameters in JavaScript.
Continue reading ➞
Post image

How to Handle Easily 'this' in JavaScript

Posted September 11, 2019
How to handle easily 'this' value in JavaScript using an additional variable, arrow functions, manual binding, or fat arrow methods.
Continue reading ➞
Post image

How To Accelerate the JavaScript Spread Operator

The fast-path optimization increases at least twice the performance of JavaScript spread operator.
Continue reading ➞