Published
Edited
May 9, 2018
3 forks
Importers
53 stars
Insert cell
Insert cell
i = {
for (let i = 0; i < 1e6; ++i) {
yield i;
}
}
Insert cell
Insert cell
function* range(n) {
for (let i = 0; i < n; ++i) {
yield i;
}
}
Insert cell
Insert cell
{
let n = 1e6;
return range(n);
}
Insert cell
Insert cell
range(1e6)
Insert cell
Insert cell
{
let sum = 0;
for (const i of range(1e3)) {
sum += i;
}
return sum;
}
Insert cell
Insert cell
{
for (const i of range(Infinity)) {
yield Promises.tick(1000, i + 1);
}
}
Insert cell
Insert cell
[...range(1e3)]
Insert cell
Insert cell
new Float32Array(range(1e3))
Insert cell
new Set(range(1e3))
Insert cell
Insert cell
function* oscillator(period) {
while (true) {
yield Math.sin(Date.now() / period);
}
}
Insert cell
Insert cell
{
for (const t of oscillator(1000)) {
yield html`<svg viewBox="0 0 12 12" width=128 height=128>
<circle stroke=black stroke-width=${1.5 + t} fill=none cx=6 cy=6 r=${3.5 + t}></circle>
</svg>`;
}
}
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