Published
Edited
Sep 19, 2020
Insert cell
Insert cell
Insert cell
function hello_standard(name) {
return "Hello "+name;
}
Insert cell
hello_arrow = (name) => "Hello "+name
Insert cell
hello_arrow('sam')
Insert cell
hello_standard('sam')
Insert cell
Insert cell
point = ({x:2, y:3})
Insert cell
Insert cell
point.x
Insert cell
point.y
Insert cell
Insert cell
AA = [1,2,3,4,5]
Insert cell
AA.slice(1,3)
Insert cell
point["x"]
Insert cell
point["y"]
Insert cell
Insert cell
Insert cell
getComponent(point,"x")
Insert cell
getComponent(point,"y")
Insert cell
Insert cell
Insert cell
A = [2, 4, 6, 8, 10]
Insert cell
pointObjects = [
{x:2,y:3},
{x:4, y:1},
{x:-1, y: 2}
]
Insert cell
Insert cell
A.length
Insert cell
Insert cell
A.slice()
Insert cell
A.slice(4)
Insert cell
A.slice(2,4)
Insert cell
Insert cell
A.map(d=>5*d)
Insert cell
Insert cell
pointArray2 = pointObjects.map(d=>[d.x,d.y])
Insert cell
Xs = pointObjects.map(d=>d.x)
Insert cell
Insert cell
Insert cell
points1stQ = pointObjects.filter(d=>d.x>=0 && d.y>=0)
Insert cell
Insert cell
Aeven = A.filter((d,i)=>(i%2==0))
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