JavaScript doesn&#x27;t guarantee the order of keys.<p>[edit]
Also, the API makes less sense because JavaScript isn&#x27;t statically typed so you can make up the result object on the fly.<p><pre><code>    match(&#x27;^(?&lt;user&gt;\w+)@(?&lt;host&gt;[^@]+)$&#x27;, &#x27;joe@example.com&#x27;) =&gt; {&#x27;user&#x27;: &#x27;joe&#x27;, &#x27;host&#x27;: &#x27;example.com&#x27;}</code></pre>