coding180 icon
Coding180

What is the difference between real DOM and virtual DOM?

Home > Interviews > Javascript


robort - 2022-10-05 06:20:49

The primary distinctions between Real DOM and Virtual DOM are shown in the following table: 

The actual DOM generates a new DOM when an element is modified. 

| Real DOM | Virtual DOM |
| Real DOM is slower to update. | Virtual DOM updates faster. |
| The real DOM can update HTML directly. | Virtual DOM cannot directly update HTML. |
| If element updates | Virtual DOM updates JSX. |
| In real DOM, DOM manipulation is very expensive. | In virtual DOM, DOM manipulation is very easy. |
| There is a lot of memory waste in the real DOM. | No memory waste in the virtual DOM. |


user

Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

Skills
  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel