Stephan Boyer created a website with some JS injected content and waited for Google to crawl it. It got indexed, but without JS execution. Only after having submitted the site manually via the Google Search Console it got indexed with JS executed.
Now, I don’t wholeheartedly agree with this, as other experiments have already verified that Google indeed indexes JS content. What I think is going on is that Google has 2 crawlers: one dumb/fast one sans JS execution (to quickly index new sites), and a smart/slow one with JS execution (which visits the site later).
Also, I once read a similar article (but cannot seem to find it back) that used
window.setTimeout to see how long Google allows the JS execution. If I remember correctly Google will let your scripts run for some time between 30 and 60 seconds max.
Does Google crawl dynamic content? →
Related, a few other Google indexing experiments I did: