Public
Edited
Apr 26
Paused
Insert cell
Insert cell
Insert cell
Insert cell
"hello"
Insert cell
2 + 1
Insert cell
Insert cell
myText = "hello"
Insert cell
Insert cell
myResult = 2 + 1
Insert cell
Insert cell
{
let originalText = "hello"
let transformedText = "hello".toUpperCase()
return transformedText
}
Insert cell
Insert cell
// JS comment
myData = [1, 2, 3]
Insert cell
<!-- HTML commment -->
<p>Some text</p>
Insert cell
Insert cell
({
name: "Gandalf",
// nickName: "Mithrandir",
age: "24_000+"
})
Insert cell
Insert cell
Insert cell
"a" // or 'a'
Insert cell
Insert cell
10
Insert cell
10_000_000
Insert cell
Insert cell
true
Insert cell
Insert cell
String(10)
Insert cell
Number('10')
Insert cell
(204401).toFixed(3)
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 = ['Gandalf', 'Sauron', 'Leto II']
Insert cell
names[0]
Insert cell
Insert cell
Insert cell
Insert cell
// myNestedArray = ...
Insert cell
Insert cell
Insert cell
// ...
Insert cell
Insert cell
Insert cell
// ...
Insert cell
Insert cell
Insert cell
myDataset = [
{name: "Gandalf", alias: "Mithrandir", age: 24_000 },
{name: "Sauron", alias: "The Great Eye", age: 54_960 },
{name: "Galadriel", alias: "Lady of Light", age: 8_372 },
{name: "Elrond", alias: "Lord of Rivendell", age: 6_000 },
{name: "Legolas", alias: "Greenleaf", age: 2_931 },
{name: "Arwen", alias: "Evenstar", age: 2901 },
{name: "Gollum", alias: "Sméagol", age: 598 },
{name: "Aragorn", alias: "Elessar", age: 89 },
{name: "R. Daneel Olivaw", alias: "Eto Demerzel,", age: 19_230 },
{name: "Dors Venabili", alias: "The Tigress", age: 183 },
{name: "Leto II", alias: "Worm", age: 3_000 },
{name: "Thanos", alias: "The Mad Titan", age: 1_000 },
{name: "The Oracle", alias: "", age: 450 },
{name: "The Architect", alias: "", age: 450 },
]
Insert cell
Insert cell
Insert cell
// ...
Insert cell
Insert cell
Insert cell
// ...
Insert cell
Insert cell
Insert cell
// ...
Insert cell
Insert cell
Insert cell
myNestedDataset = [
{lordOfTheRings: [
{name: "Gandalf", alias: "Mithrandir", age: 24_000 },
{name: "Sauron", alias: "The Great Eye", age: 54_960 },
{name: "Galadriel", alias: "Lady of Light", age: 8_372 },
{name: "Elrond", alias: "Lord of Rivendell", age: 6_000 },
{name: "Legolas", alias: "Greenleaf", age: 2_931 },
{name: "Arwen", alias: "Evenstar", age: 2901 },
{name: "Gollum", alias: "Sméagol", age: 598 },
{name: "Aragorn", alias: "Elessar", age: 89 },
]},
{foundation: [
{name: "R. Daneel Olivaw", alias: "Eto Demerzel", age: 19_230 },
{name: "Dors Venabili", alias: "The Tigress", age: 183 },
]},
{dune: [
{name: "Leto II", alias: "Worm", age: 3_000 },
]},
{marvel:[
{name: "Thanos", alias: "The Mad Titan", age: 1_000 }
] },

{theMatrix: [
{name: "The Oracle", alias: "", age: 450 },
{name: "The Architect", alias: "", age: 450 },
]}
]
Insert cell
myNestedDataset[0]
Insert cell
myNestedDataset[0].lordOfTheRings[0].name
Insert cell
Insert cell
Insert cell
myString = 'a'
Insert cell
myNumber = 1
Insert cell
myString.constructor.name
Insert cell
myNumber.constructor.name
Insert cell
Insert cell
Insert cell
names
Insert cell
Insert cell
Insert cell
names.forEach((d) => console.log(d + " is old."))
Insert cell
Insert cell
Insert cell
Insert cell
// modifiedNames = ...
Insert cell
Insert cell
Insert cell
Insert cell
// namesStartingWithS = ...
Insert cell
Insert cell
Insert cell
Insert cell
names
Insert cell
Insert cell
postFix = function(d) {
return d + ' is old.'
}
Insert cell
Insert cell
names.map( postFix )
Insert cell
Insert cell
names.map( function(d) {
return d + ' is old.'
} )
Insert cell
Insert cell
names.map( function(d) {return d + ' is old.'} )
Insert cell
Insert cell
names.map( (d) => {return d + ' is old.'} )
Insert cell
Insert cell
names.map( (d) => d + ' is old.' )
Insert cell
Insert cell
names.map( d => d + ' is old.' )
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
sum = 2 + 5
Insert cell
sumIsSeven = sum === 7 ? true : false
Insert cell
allIsGood = true
Insert cell
color = allIsGood
? 'green'
: 'red'
Insert cell
Insert cell
color2 = {
if(allIsGood){
return 'green'
}
else{
return 'red'
}
}
Insert cell
Insert cell
1 === 1
Insert cell
2 !==1
Insert cell
2 > 5
Insert cell
2 >= 5
Insert cell
2 <= 5
Insert cell
Insert cell
Insert cell
true && true
Insert cell
true && false
Insert cell
Insert cell
true || true
Insert cell
true || false
Insert cell
false || true
Insert cell
Insert cell
1 + 1
Insert cell
2 - 10
Insert cell
2 * 10
Insert cell
2 / 10
Insert cell
10 % 3 // modulus
Insert cell
Insert cell
Insert cell
import {imageToDo} from "@clokman/student-blocks"
Insert cell
imageToDo
Insert cell
import {openAllLinksInNewTab} from "@clokman/open-all-links-in-new-tab"
Insert cell
openAllLinksInNewTab
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