I have discovered this little gem, allowing you to do the same in pure Javascript: <a href="https:&#x2F;&#x2F;github.com&#x2F;leeoniya&#x2F;domvm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;leeoniya&#x2F;domvm</a><p>The equivalent would be something like<p><pre><code>  function() selected { return true }
  [&quot;h2&quot;, {class: function() {if (selected()) {return &quot;selected&quot;}}}, &quot;Hello&quot;]
</code></pre>
Not as clean, but still usable IMO