Published
Edited
Mar 9, 2020
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
function pbjMakers(breadType, JellyType, PeanutAllergy) {
if (PeanutAllergy === true) {
return "Why don't we make you something else?";
}
else {
return (
"Here is your peanut butter and " +
JellyType +
" jelly sandwich on " +
breadType +
" bread."
);
}
}

return pbjMakers("Rye", "Rasberry", "true");
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
function watchYTVideo(videoTitleType="clickbait"){
if(videoTitleType === "clickbait"){
return false
} else {
return true
}
}
}
Insert cell
Insert cell
Insert cell
sharingRainbowFish = rainbowFish.giveShinyScale
Insert cell
sharingRainbowFish("Harper Hermit Crab")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
car = {
return {
mph = 0,
AvgMPG = 25.0,
brakesWork = true,
tirePressureAbove30 = true,
accelerate: function() {
mph += 10
},
pressBrake: function(){
if(brakesWork === true){
mph -= 10
}
}
}
}
Insert cell
Insert cell
Insert cell
Insert cell
class Dog extends Animal {
constructor(name, sex, breed) {
super(name, "dog", sex);
}
constructor(name, sex, breed){
this.breed = breed;
}
introduce() {
return introduce() + " Woof woof!";
}

bark() {
return "woof";
}
}
Insert cell
Insert cell
class Reptile {
constructor(name, color) {
this.color = color;
this.name = name;
this.warm = true;
}
introduce() {
return `My name is ${this.name} and I am a reptile!`
}
sun(){
this.warm = true
}
shade(){
this.warm = false
return "I should go lay down in the sun, its pretty cold"
}
}
Insert cell
class turtle extends Reptile {
//WRITE THE CODE HERE
}
Insert cell
Insert cell
Insert cell
{
function mathStuffs (a,b){
const y = 17;
if(a <= b){
let c = a + b;
}
else{
y = 19;
let c = a - b + y;
}
return c;
}
return mathStuffs(18,2)
}
Insert cell
Insert cell
{
function cheapDateFunc(price) {
if (bill < 15) {
return "You Pay";
} else {
return "I will pay";
}
}
function tipCalc() {
var tip = bill * .15;
return tip;
}

return rudeDateFunc(tipCalc() + 60);
}
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