How to check JavScript merge is enabled programmatically Magento 2?

Check Javascript file Merge is enable using Magento 2 by isMergeJsFiles() from the ConfigInterface.

To Merge JavaScript files in Magento 2 via admin panel,
Go To Admin panel,
Click Stores -> Settings -> Configuration from the left sidebar.
Click on Advanced -> Select Developer Tab,
Open the JavaScript Settings section,
Choose Yes from the Merge JavaScript Files.
Click Save Config from the top right.

You can Check whether merging of JavScript files is on using programmatically way,

namespace Jesadiya\Merge\Model;

use Magento\Framework\View\Asset\ConfigInterface;

class JsMerge
     * @var ConfigInterface
    private $merge;

    public function __construct(
        ConfigInterface $merge
    ) {
        $this->merge = $merge;

     * Check js merge is enabled.
     * @return boolean
    public function isJsMergeEnabled()
        return $this->merge->isMergeJsFiles();

echo $this->isJsMergeEnabled(); // result bool
You got the result as true or false using the above line.


You can check JS Merge with the simple method.