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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more