Popular posts

JavaScript
React
Post image

Type Checking in JavaScript is Slightly Screwed

"typeof" and "instanceof" perform the type checking in JavaScript. While they are generally simple to use, make sure to known the edge cases.
Continue reading ➞
Post image

The Benefits of Orthogonal React Components

How to design React components that are easy to change, maintain, and test? Strive to orthogonal React components.
Continue reading ➞
Post image

15 Common Operations on Arrays in JavaScript (Cheatsheet)

Updated December 24, 2019
15 operations on arrays in JavaScript: iterate, map, reduce, concat, slice, clone, search, query, filter, insert, remove, empty, fill, flatten and sort.
Continue reading ➞
Post image

The Wise Guide to React useState() Hook

Posted November 13, 2019
React useState() hook manages the state of functional components.
Continue reading ➞
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

JavaScript Closure: The Beginner's Friendly Guide

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 March 17, 2023
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 ➞