Google cannot crawl JavaScript, but it can render JavaScript. This means it can transform JavaScript into rendered HTML which is crawlable by Google crawlbots. Once that is done, the crawlbots can proceed to crawl and index your webpage as they would otherwise.