innerText vs textContent take 10

In notebook:
Article Notes
Created at:
2018-11-20
Updated:
2018-11-20
Tags:
JavaScript Performance DOM

⚠️ You probably don't want .innerText

Why? It triggers layout! 🦑 This happens because the string contains newlines corresponding to blocks, and hidden content is omitted.

💁‍♀️ Solution: use .textContent instead.

Jason Miller @_developit https://twitter.com/_developit/status/1064548725891231745