Let’s take a look at differences and how each method works.
There are two surprising behaviors on Chrome Developer Tool Console (“console” hereafter).
First one was pointed out by my friend Nicolas Marcora that you can await an async method, and second one being $$ (a short-cut for document.querySelectorAll) returning an array, not a NodeList object.
Let’s go over how they are different.
You know how to add numbers progmatically, right?
1 + 1 will basically give you 2.
Numbers are added in binary form down in machine level.
But how do numbers get added underneath the hood?
I will show how to add “positive” integers (no floating) using boolean operations.
Watch out when exposing a mutable data structure with React Hooks
When you spread an object instance of a class to expose methods, methods might not be copied over.
Suppose that you have a
which you want to make it immutable by returning a new object using syntax spread.
Not a good idea! Explained later.
trie object instance returned from
useTrie won’t show
has and an empty method is printed.
Let’s see why and how to solve the issue.