Published
Edited
Dec 6, 2020
Insert cell
Insert cell
{
initialization;
console.clear();
for (let i = 0; i < n; i++) {
const j = parseInt(localStorage.getItem('x'));
localStorage.setItem('x', j + 1);
if (!(i % 1000)) console.log('value at iteration', i, 'is', j);
}
return localStorage.getItem('x');
}
Insert cell
n = 10000
Insert cell
initialization = localStorage.setItem('x', 0)
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