Published
Edited
Apr 24, 2020
Importers
Insert cell
Insert cell
Insert cell
a = new MapWithCurrent([[1, 'uno'], [2, 'dos']], 2, 1)
Insert cell
Insert cell
a instanceof Map
Insert cell
Insert cell
a instanceof NonEmptyMap
Insert cell
Insert cell
a instanceof MapWithCurrent
Insert cell
Insert cell
{
const b = new MapWithCurrent([[1, 'uno'], [2, 'dos']], 2);
return b.currentKey;
}
Insert cell
Insert cell
c = new MapWithCurrent(a, a.defaultKey)
Insert cell
Insert cell
c.currentKey
Insert cell
{
const d = new MapWithCurrent(a, a.currentKey);
d.currentKey = 1;
return d.currentKey;
}
Insert cell
Insert cell
c.current
Insert cell
Insert cell
// Error
new MapWithCurrent(a, a.currentKey, 5)
Insert cell
// Error
(a.currentKey = 5)
Insert cell
Insert cell
{
const d = new MapWithCurrent(a, 2, 1);
d.delete(d.currentKey);
return d.currentKey;
}
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