Published
Edited
Apr 24, 2020
1 fork
Importers
Insert cell
Insert cell
Insert cell
a = new MapWithDefault([[1, 'uno'], [2, 'dos']], 2)
Insert cell
Insert cell
a instanceof Map
Insert cell
Insert cell
a instanceof NonEmptyMap
Insert cell
Insert cell
b = new MapWithDefault(a, a.defaultKey)
Insert cell
Insert cell
b.defaultKey
Insert cell
{
const c = new MapWithDefault(b, b.defaultKey);
c.defaultKey = 1;
return c.defaultKey;
}
Insert cell
Insert cell
b.default
Insert cell
Insert cell
// Error
d = new MapWithDefault(b, 3)
Insert cell
// Error
(b.defaultKey = 5)
Insert cell
Insert cell
// Error
b.delete(b.defaultKey)
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more