Published
Edited
Aug 1, 2020
Insert cell
md`# flow control`
Insert cell
sentence = {
// start
var sentence = ""
var time = 6
if (time > 8 || time <= 24) {
sentence = "Hello!"
}else {
sentence = "Good morning!"
}
return sentence
}
Insert cell
block = {
var time = 6
//////// 0 || 1 = true
return time > 8 || time <= 24
}
Insert cell
{
// 0 + 1 +2 + 3 + 4 = 10
// i = i+ 2 : 0 + 2 + 4 = 6
let sum = 0;
for (var i = 0; i < 5; i = i + 2) {
sum = sum + i;
}
return sum;
}
Insert cell
{
var i= 0
i++ // i = i + 1
return i
}
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