Published
Edited
Aug 31, 2020
1 fork
7 stars
Insert cell
Insert cell
aChar = "Hello There!"[6]
Insert cell
Insert cell
aSlice = "Hello There!".slice(6,11)
Insert cell
Insert cell
{
let orderNum = 8;
return "You are number " + (orderNum + 1) + " in line.";
}
Insert cell
Insert cell
Insert cell
Insert cell
d3.csv("https://cdn.rawgit.com/vlandham/js_data/master/data/cities_spaced.csv", function(d) {
let cleanD = {};
d3.keys(d).forEach(function(k) {
cleanD[_.trim(k)] = _.trim(d[k]);
});
return cleanD;
})
Insert cell
Insert cell
"A man, a plan, a canal".indexOf("man") !== -1
Insert cell
"A man, a plan, a canal".indexOf("panama") !== -1
Insert cell
Insert cell
"A man, a plan, a canal".replace("canal", "")
Insert cell
Insert cell
Insert cell
Insert cell
html_snippet = "<div class=\"person\">" +
"<span class=\"name\">" + person.name + "</span>" +
"<span class=\"occupation\">" + person.occupation + "</span>" +
"</div>"
Insert cell
Insert cell
`<div class="person">
<span class="name">${person.name}</span>
<span class="occupation">${person.occupation}</span>
</div>`
Insert cell
Insert cell
templateFunction = (person) => {
return `<div class="person">
<span class="name">${person.name}</span>
<span class="occupation">${person.occupation}</span>
</div>`
}
Insert cell
templateFunction({ name : "James. James Bond", occupation: "Spy" })
Insert cell
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