Published
Edited
Apr 15, 2020
Fork of Hello mem
Importers
1 star
Also listed in…
Hello
Insert cell
Insert cell
a = randomObject()
Insert cell
b = randomObject()
Insert cell
c = randomObject()
Insert cell
d = randomObject()
Insert cell
value = randomObject()
Insert cell
map = {
const map = new DeepWeakMap();
map.set([a, b, c], value);
return map;
}
Insert cell
map.has([a, b, c]) // → true
Insert cell
map.has([a, b, d]) // → false
Insert cell
map.get([a, b, c]) // → value
Insert cell
map.get([a, b, d]) // → undefined
Insert cell
{
map.delete([a, b, c]);
const result = map.has([a, b, c]); // → false

map.set([a, b, c], value); // <- reset to previous state
return result;
}
Insert cell
Insert cell
a1 = ({ key: 'value' })
Insert cell
a2 = ({ key: 'value' })
Insert cell
map2 = {
const map2 = new DeepWeakMap();
map2.set([a1], 'some value');
return map2;
}
Insert cell
map2.has([a1])
Insert cell
map2.has([a2])
Insert cell
Insert cell
map3 = new DeepWeakMap()
Insert cell
map3.set([1], 'some value') // -> error
Insert cell
map3.set(["a"], 'some value') // -> error
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more