Published
Edited
May 19, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x = 10 + 5;
Insert cell
Insert cell
y = x - 2;
Insert cell
Insert cell
function subtractTwo(inputNumber){
return inputNumber - 2;
}
Insert cell
Insert cell
z = subtractTwo(x);
Insert cell
Insert cell
Insert cell
message = "The value of x is: " + x;
Insert cell
Insert cell
p5(sketch => {
 sketch.setup = function() {
sketch.createCanvas(600, 100);
   sketch.background(255);
sketch.noStroke();
sketch.fill(200, 50, 50); // set the color to Red, (more on this later, trust me)
sketch.rect(100, 25, 50,50);
sketch.fill(50, 200, 50); // set the color to Green, (more on this later, trust me)
sketch.rect(300, 25, 50,50);
sketch.fill(50, 50, 200); // set the color to Blue, (more on this later, trust me)
sketch.rect(500, 25, 50,50);
};
})
Insert cell
Insert cell
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