Public
Edited
Jan 9, 2023
17 forks
3 stars
Insert cell
Insert cell
Insert cell
yourname = "a boring name"
Insert cell
print = "Hello " + yourname + "!"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
42 === "42"
Insert cell
number = 42
Insert cell
Insert cell
string_number = +"42"
Insert cell
number === string_number
Insert cell
Insert cell
not_a_number = +"forty-two"
Insert cell
dollas = +"$42"
Insert cell
Insert cell
Insert cell
6 + 2
Insert cell
forty = 1 + 2
Insert cell
forty + 5
Insert cell
Insert cell
Insert cell
array = ["a", 6, "6", "forty"] // notice this? Anything after // is a comment, and isn't read by the program.
// This is a comment to bring your attention to the strings like "a" and "forty" // are in quotes, while the integer 6 can stand alone without quotes!
Insert cell
Insert cell
array[0]
Insert cell
Insert cell
index_of_forty = ???
Insert cell
Insert cell
list = [
{ first_name: "Maeve", last_name: "Kane" },
{ first_name: "Patrick", last_name: "Nold" }
]
Insert cell
Insert cell
list[0].last_name
Insert cell
Insert cell
chair_first_name = ??
Insert cell
Insert cell
Insert cell
function greet(another_variable) {
return `Hello, ${another_variable}!`;
}
Insert cell
greet(yourname)
Insert cell
Insert cell
p_nold_greet = greet(??)
Insert cell
Insert cell
Insert cell
data = FileAttachment("1915State@1.csv").csv()
Insert cell
Insert cell
data.length
Insert cell
Insert cell
Object.keys(data[0])
Insert cell
Insert cell
Insert cell
d3 = require("d3@6")
Insert cell
Insert cell
median = d3.median(data, d => +d.age)
Insert cell
Insert cell
min = d3.min(data, d => +d.age)
Insert cell
Insert cell
max = ??
Insert cell
Insert cell
Insert cell
Insert cell
yourname
Insert cell
max
Insert cell
p_nold_greet
Insert cell
chair_first_name
Insert cell
index_of_forty
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