Published
Edited
Jun 3, 2020
Insert cell
md`# Observable is not JavaScript`
Insert cell
This is English, not Javascript
Insert cell
{throw new Error("get shrekt")}
Insert cell
{ var local = "I am a local variable."; }
Insert cell
local
Insert cell
a + 2
Insert cell
a = 1
Insert cell
c1 = c2 - 1
Insert cell
c2 = c1 + 1
Insert cell
b = Math.random()
Insert cell
b * b
Insert cell
// handling promises
hello = new Promise(resolve => {
setTimeout(() => {
resolve("hello there");
}, 30000);
})
Insert cell
hello.split(/\s+/g) // i
Insert cell
c = {
yield 1;
yield 2;
yield 3;
}
Insert cell
c
Insert cell
{
let sum = 0;
for (let i = 0; i < 10; ++i) {
sum += i;
}
return sum;
}
Insert cell
object = ({foo: "bar"})
Insert cell
viewof text = html`<input value="edit me">`
Insert cell
mutable thing = 0
Insert cell
++ mutable thing
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