returnproductOfTwoVariables// <-- ignore that return. it's to make the notebook work
}
{
varbob=function(){return"Hi, I'm in Bob!"}
varjoe=bob()+" And now I'm called by Joe!"
returnjoe
}
functioncheckDay(today){
if(today==="Sunday"||today==="Saturday"){
return"WEEKEND"
}else{
return"WEEKDAY"
}
}
checkDay("Sunday")
{
// COUNTING TO TEN
varcount=0
while(count!=10){
count=count+1;
}
returncount;
}
{
// COUNTING TO TEN
varcount=0
for(vari=0;i<10;i++){
count=count+1
count=count+1
count=count+1
count=count+1
count=count+2
count=count+1
count=count+1
count=count+1
count=count+1
}
returncount
}
functiontestable(isGood){
if(isGood===true)
return"yes"
return"no"
}
test1=testable(true)==="yes"
test2=testable(false)==="no"
test3=testable(1)==="yes"
functionsleepIn(weekday,vacation){
returnundefined;
}
functionhasTeen(num1,num2,num3){
returnundefined;
}
functionfront3(str){
returnundefined;
}
functionfindPrimes(input)
{
returnundefined;
}
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.