Magento2 Add additional js files to home page only

Is it possible to add additional javascript files to just the home page in Magento 2?


The current code works. However the files are placed on every page which is not needed.

Theme/Magento_Theme/layout/default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Magento_Catalog::js/sample1.js"/>
        <link src="js/sample.js"/>
    </head> 
</page>


Go to Source of this post
Author Of this post: themanwhoknowstheman
Title Of post: Magento2 Add additional js files to home page only
Author Link: {authorlink}