Engrain by ByteRush

JS.16.09 Mid-levelCore — asked often

DOM utilities

Comes up in: Coding, UI coding

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • getElementsByClassName / querySelectorAll subset via tree walk
  • event delegation helper with closest
  • serialize DOM to JSON and back
  • find a node in a cloned tree (path of indices)
  • virtual-DOM render(vnode) plus diff/patch

Words you will know

tree walkvirtual DOM

What you will practise

  • implement 4 DOM utilities

Interview questions this answers

  • Implement getElementsByClassName without using built-in selectors.