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){
if(!weekday||vacation)
{
returntrue;
}else
returnfalse;
}// actual hours of my life were used in the process of websites telling me how to do if statements and curly brackets and me being slightly wrong
functionhasTeen(num1,num2,num3){
// if (13>=num1<=19) || (13>=num2<=19) || (13>=num3<=19) {
// return true;
// }
// return false;
// } why doesn't this work, but when I extend it out it works? it should only need to test for 1 of the nums being positive right? I kinda just ordered everything in a more drawn out way and it worked. what even is coding?
//I don't know what I did here, and I had to create a new cell. Everything is messing up and I'm not learning anything, so I'm taking the L on this question. I will write it on paper and see if I'm actually doing the write thing.
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.