In the module located at app/code/MyCompany/MyModule there is a JS module in the file view/frontend/web/register.js. The Magento base URL is https://magento.host/ and the luma theme with the en_US locale is used.
What is the public URL for this file?
A. https://magento.host/pub/static/frontend//Magento/luma/en_US/MyCompany_MyModule/js/register.js
B. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/register.js
C. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/web/register.js
D. https://magento.host/app/code/MyCompany_MyModule/view/frontend/web/register.js
Answer b
Answer B
Answer: B
Answer B
https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js-resources.html#accessing-js-resources
Example 3
Here answer B should be correct.
A would be only with path view/frontend/web/js/register.js
In question ther is view/frontend/web/register.js without js directory so it will lead to rather B