CLOVIS
09/12/2024, 5:33 PMval data = WeakMap<String, User>()
data["1234"] = User(…)
data["5678"] = User(…)
println(data["1234"]) // Maybe a User, maybe null
Weak references allow the runtime to free objects before variables go out of scope. They are particularly helpful to optimize complex applications to reduce memory usage, in particular within the implementation of caches.
Learn more: documentation • what's new? • #C078Z1QRHL3Niraj Patidar
09/13/2024, 5:00 AMCLOVIS
09/14/2024, 9:24 AMNiraj Patidar
09/14/2024, 4:15 PM