This code combines ES + Javascript mixture to demo how to achieve results using both.
into <head>
of /public/index.html
<script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script>
const { tableau } = window;
https://help.tableau.com/current/api/js_api/en-us/JavaScriptAPI/js_api_samples.htm