Insert cell
Insert cell
Insert cell
{
// COUNTING TO TEN
var count = 0
while( count !== 10 ) { //Notice that count !== 10 evaluates to a boolean
count = count + 1;
}
return count;
}
Insert cell
Insert cell
Insert cell
Insert cell
{
// COUNTING TO TEN
var count = 0
for( var i = 0; i < 10; i = i + 1 ) {
count = count + 1
}
return count
}
Insert cell
{
//An alternate way of counting to 10
for( var count = 0; count < 10; count = count + 1 ) {
//We're not doing anything inside the for loop except repeating it 10 times...
}
return count
}
Insert cell
Insert cell
Insert cell
function front3(str) {
return undefined;
}
Insert cell
Insert cell
Insert cell
function findPrimes(input)
{
return undefined;
}
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