Public
Edited
Jan 5
4 forks
Insert cell
Insert cell
Insert cell
paragraph = 'Founded in 1898, we’re renowned for our experiential learning model, high-impact research, deep partnerships, and worldwide reach. From day one, we’ve pursued innovative ways of teaching and research that place a premium on experience and engagement with the world. Today, our signature approach erases traditional boundaries, empowering not only students, but faculty, alumni, partners, and innovators to solve problems and pursue impact.'
Insert cell
paragraph.length
Insert cell
Insert cell
words = paragraph.split(' ')
Insert cell
Insert cell
words.length
Insert cell
Insert cell
words[1]
Insert cell
Insert cell
new Set(words).size
Insert cell
Insert cell
prices = ({
milk: 3.45,
crackers: 4.54,
pepsi: 1.00,
chips: 2.98,
})
Insert cell
prices.milk
Insert cell
prices["milk"]
Insert cell
Insert cell
food = "chips"
Insert cell
prices[food]
Insert cell
Insert cell
prices
Insert cell
Insert cell
[
["milk", 3.45],
["crackers", 4.54],
["pepsi", 1.00],
["chips", 2.98]
]
Insert cell
kvps = Object.entries(prices)
Insert cell
Insert cell
Object.fromEntries(kvps)
Insert cell
Insert cell
items = new Map(kvps)
Insert cell
Insert cell
items.get("milk")
Insert cell
Insert cell
snack = "chips"
Insert cell
items.get(snack)
Insert cell
Insert cell
Array.from(items.keys())
Insert cell
[...items.keys()]
Insert cell
Insert cell
items
Insert cell
Array.from(items)
Insert cell
Insert cell
Array.from(items, ([item, cost]) => ({item, cost}))
Insert cell
Array.from(items, function (pair){
return {
item: pair[0],
cost: pair[1]
}
})
Insert cell
Insert cell
function triangleArea(base, height) {
return base * height / 2;
}
Insert cell
triangleArea(10, 20)
Insert cell
triangleArea2 = (base, height) => base * height / 2
Insert cell
triangleArea2(10, 20)
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