How does the Virtual DOM work?
If you’re anything like me you will have heard the term “Virtual DOM” mentioned in a million different tutorials and articles, and probably mixed up the use of the term Virtual and Shadow DOM assuming they’re the same thing (or maybe that was just me).
I’ve never really taken the time to properly understand what it is though, or why it even exists in the first place. Sarah takes us on a journey to explain just those concepts.
![](../../../../wp-content/uploads/2020/02/Virtual-DOM-800x460.png)
Here is the DOM
An excerpt from How does the Virtual DOM work?
We make a copy in JavaScript called the Virtual DOM
We do this because touching the DOM with JavaScript is computationally expensive.