Published
Edited
Jul 1, 2018
1 star
Insert cell
Insert cell
Insert cell
sample_integer1 = 37
Insert cell
sample_integer2 = -5
Insert cell
strings = md`
### Javascript Strings
Strings are a series of characters surrounded by single quotes (_e.g._, 'hello') or double quotes (_e.g._, "hello"). If there is an embedded \" when using double-quotes, or an embedded \' when using single-quotes, you must use the backslash (\\) to quote the embedded character (see string_example2).
`
Insert cell
string_example = "Mary had a little lamb, it's fleece was white as snow"
Insert cell
string_example2 = 'Mary had a little lamb, it\'s fleece was white as snow'
Insert cell
Insert cell
array_example = [12,27,39,-3,8,0,-15]
Insert cell
md`array_example[3] = ${array_example[3]}`
Insert cell
Insert cell
Insert cell
object_example = ({type: "person", firstName: "joe", lastName: "smith", age: 27})
Insert cell
md`object_example.lastName = ${object_example.lastName}`
Insert cell
Insert cell
Insert cell
recent_cars = cars.filter(e => e.year > 2005)
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