Skip to content

Instantly share code, notes, and snippets.

@davidmyersdev
Created August 24, 2020 03:09
Show Gist options
  • Save davidmyersdev/e0dcc9f754b44bdaf068bafa2d251cdb to your computer and use it in GitHub Desktop.
Save davidmyersdev/e0dcc9f754b44bdaf068bafa2d251cdb to your computer and use it in GitHub Desktop.

Revisions

  1. davidmyersdev created this gist Aug 24, 2020.
    11 changes: 11 additions & 0 deletions kitboga.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function doTheThing(element) {
    let children = Array.from(element.childNodes);

    if (children.length) {
    children.forEach(child => doTheThing(child));
    } else {
    element.textContent = 'hi';
    }
    }

    doTheThing(document.body);