<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged js bigint</title>
<link>https://ask.clojure.org/index.php/tag/js%20bigint</link>
<description>Powered by Question2Answer</description>
<item>
<title>Can js/BigInt be used as a map key in ClojureScript?</title>
<link>https://ask.clojure.org/index.php/10938/can-js-bigint-be-used-as-a-map-key-in-clojurescript</link>
<description>&lt;p&gt;js/BigInt supports equality testing (= (js/BigInt 4) (js/BigInt 4)) is true so I expected to be able to use it as a key in a map (I don&#039;t know what hash function is used for the lookup)&lt;br&gt;
However I see some unexpected behaviour:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; (get {0 0 1 1 2 2 3 3 (js/BigInt 4) 4 5 5 7 7 8 8} (js/BigInt 4))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;returns &lt;code&gt;4&lt;/code&gt; as expected, but&lt;/p&gt;
&lt;p&gt;&lt;code&gt; (get {0 0 1 1 2 2 3 3 (js/BigInt 4) 4 5 5 7 7 8 8 9 9} (js/BigInt 4))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;returns &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This was tested using Firefox or Safari as the javascript engine. &lt;/p&gt;
&lt;p&gt;Is this a bug or was I just lucky that it worked for maps with less than 10 entries?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10938/can-js-bigint-be-used-as-a-map-key-in-clojurescript</guid>
<pubDate>Fri, 13 Aug 2021 02:19:31 +0000</pubDate>
</item>
</channel>
</rss>