TreeWalker is a generator-like interface that makes recursively filtering nodes in a DOM tree easy and efficient.
The following code concatenates the value of all Text nodes in the page, and prints the result.
let parentNode = document.body;
let treeWalker = document.createTreeWalker(parentNode, ...