count elements with specific data using ES6 concatenation : <p>trying to use <code>ecmascript 6</code> variable concatenation.</p>

<p>Expecting <code>exists</code> in console but getting error.  Please help:  </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let path = 'abc';
if($('.title[data-path=${path}]').length &gt; 0){
  console.log('exists');
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;

&lt;div class='title' data-path = 'abc'&gt;lorem&lt;/div&gt;
&lt;div class='title' data-path = 'def'&gt;ipsum&lt;/div&gt;
&lt;div class='title' data-path = 'abc'&gt;lorem&lt;/div&gt;</code></pre>
</div>
</div>
</p>
