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.

Here is the DOM
We make a copy in JavaScript called the Virtual DOM
We do this because touching the DOM with JavaScript is computationally expensive.

An excerpt from How does the Virtual DOM work?

View original article

Subscribe to our Newsletter

Add your email address and receive an email every Friday covering off everything worth knowing about building your websites responsively.