JavaScript redirects are followed similarly to server-side redirects, Google explained.
Please visit Search Engine Land for the full article.
Search Engine Land: News & Info About SEO, PPC, SEM, Search Engines & Search Marketing https://searchengineland.com/yes-googlebot-can-detect-javascript-redirects-320422