Created
August 24, 2020 03:09
-
-
Save davidmyersdev/e0dcc9f754b44bdaf068bafa2d251cdb to your computer and use it in GitHub Desktop.
Revisions
-
davidmyersdev created this gist
Aug 24, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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);