<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>WeakMap</title><link>https://blog.ast.moe/en/tags/weakmap/</link><description>Recent posts: Gorimuchu</description><generator>Hugo</generator><item><title>What is a WeakMap?</title><link>https://blog.ast.moe/en/blog/2026-10-08/</link><pubDate>Thu, 08 Oct 2026 21:50:47 +0900</pubDate><guid>https://blog.ast.moe/en/blog/2026-10-08/</guid><description>&lt;p&gt;JavaScript has &lt;code&gt;Map&lt;/code&gt;, which stores key‑value pairs, and a similarly named &lt;code&gt;WeakMap&lt;/code&gt;. Both can be registered with &lt;code&gt;set()&lt;/code&gt; and retrieved with &lt;code&gt;get()&lt;/code&gt;. However, WeakMap does not have &lt;code&gt;size&lt;/code&gt; nor &lt;code&gt;keys()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A WeakMap is a mechanism that associates information with objects without keeping the objects in memory solely because of that association. The term “weak” refers not to the data’s reliability or the accuracy of lookups, but to how the references to the keys are treated.&lt;/p&gt;</description></item></channel></rss>