Public
Edited
Dec 15, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
names = [{ name: "Giacomo", lastname: "Nanni" }]
Insert cell
Insert cell
Insert cell
5 + 5
Insert cell
"hello" + "world"
Insert cell
Insert cell
10 - 3;
Insert cell
5 * 2
Insert cell
10 / 2
Insert cell
Insert cell
myNumber = 10
Insert cell
myNumber + 10
Insert cell
Insert cell
10 == 10
Insert cell
10 === "10"
Insert cell
10 != 9
Insert cell
Insert cell
{
if (myNumber == 10) {
return "correct!";
} else {
return "wrong";
}
}
Insert cell
Insert cell
function multiply(num1, num2) {
return num1 * num2;
}
Insert cell
function subtract(num1, num2) {
return num1 - num2;
}
Insert cell
multiply(5, 5)
Insert cell
subtract(5, 1)
Insert cell
Insert cell
{
for (let i = 1; i <= 10; i++) {
console.log(i);
}
}
Insert cell
{
for (const i of mylist) {
console.log(i);
}
}
Insert cell
Insert cell
// This is a comment
Insert cell
/* this is a comment which
goes on multiple lines */
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