How to get url for static image file in Magento 2's javascript files?
<p>I need to get a URL for an image stored in my theme (<code>app/design/frontend/MyVendor/MyTheme/web/images/image.png</code>) from a javascript file (<code>payment.js</code>).</p>

<p>In PHP I can do it like this: </p>

<pre><code>&lt;?php echo $block-&gt;getViewFileUrl('images/image.png') ?&gt;
</code></pre>

<p>How can I do this in JavaScript?</p>