Despite the resources they can invest in web development, large e-commerce websites still struggle with SEO-friendly ways of using JavaScript.
And, even when 98% of all websites use JavaScript, it’s still common that Google has problems indexing pages using JavaScript. While it’s okay to use it on your website in general, remember that JavaScript requires extra computing resources to be processed into HTML code understandable by bots.