Public
Edited
Oct 31, 2022
30 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
squareIt = function(x) {
return x * x;
}
Insert cell
Insert cell
squareItArrow = x => x * x
Insert cell
Insert cell
squareIt(79)
Insert cell
squareItArrow(79)
Insert cell
Insert cell
costumes = [
{costume: "witch", price: 18.50},
{costume: "ghost", price: 7.99},
{costume: "pumpkin", price: 23.99},
{costume: "ghoul", price: 18.00},
{costume: "skeleton", price: 13.50}
]
Insert cell
Insert cell
costume_tax = costumes.map(d => d.price * 0.0725)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const type = "ghost";

if (type == "ghost") {
return "BOO!"
} else {
return "meow"
}
}
Insert cell
Insert cell
Insert cell
{
const type = "ghost";

return type == "ghost" ? "BOO!" : "meow"
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
treats = [
{type: "Snickers", count: 6},
{type: "Skittles", count: 22},
{type: "Mars", count: 13},
{type: "M&Ms", count: 4}
]
Insert cell
share = treats.map(d => d.count / 2)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
2 == "2" // Loose equality operator
Insert cell
2 === "2" // Strict equality operator
Insert cell
2 === 2 // Strict equality operator
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