Skip to content

Pigs 20 threshold #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Loops
  • Loading branch information
dbekenstein committed Apr 3, 2024
commit 9f49c19f5c2efac83a8bfcdf7abd62cf3499647d
Binary file modified .DS_Store
Binary file not shown.
120 changes: 119 additions & 1 deletion 02-Fundamentals-Part-2/starter/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ console.log(fruitProcessor(5, 1));

const calcAge3 = (birthYear) => 2037 - birthYear;
console.log(calcAge3(1994));
*/

const calcAverage = (scr1, scr2, scr3) => (scr1 + scr2 + scr3) / 3;

let scoreDolphins = calcAverage(44, 23, 71);
Expand All @@ -34,3 +34,121 @@ function checkWinner(avgDolphins, avgKoalas) {
}

checkWinner(scoreDolphins, scoreKoalas);
*/

/*
const friends = ["Michael", "Steven", "Peter"];
console.log(friends);

console.log(friends[0]);
console.log(friends[2]);

console.log(friends.length);
console.log(friends[friends.length - 1]);

friends[2] = "Jay";
console.log(friends);

const dan = ["Dan", "Bekenstein", 2024 - 1994, "Product Manager", friends];
console.log(dan);
console.log(dan.length);

const calcAge = function (birthYear) {
return 2037 - birthYear;
};
const years = [1990, 1967, 2002, 2010, 2018];

const age1 = calcAge(years[0]);
const age2 = calcAge(years[1]);
const age3 = calcAge(years[years.length - 1]);
console.log(age1, age2, age3);
*/

/*
const friends = ["Michael", "Steven", "Peter"];
const newLength = friends.push("Jay");
console.log(friends);
console.log(newLength);

friends.unshift("John");
console.log(friends);

const popped = friends.pop();
console.log(friends);
console.log(popped);

friends.shift();
console.log(friends);

console.log(friends.indexOf("Steven"));

console.log(friends.includes("Peter"));
console.log(friends.includes("Dan"));

if (friends.includes("Steven")) {
console.log("You have a friend called Steven");
}
*/
/*
const dan = {
firstName: "Dan",
lastName: "Bekenstein",
age: 2024 - 1994,
job: "Product Manager",
friends: ["Tim", "Justin", "Greg"],
};

console.log(dan);
console.log(dan.lastName);
console.log(dan["lastName"]);

const nameKey = "Name";

console.log(dan["first" + nameKey]);
console.log(dan["last" + nameKey]);

// const interestedIn = prompt(
// "What do you want to know about Dan? Choose between firstName, lastName, age, job, and friends"
// );
// console.log(dan[interestedIn]);


dan.location = "US";
dan["city"] = "Boston";

console.log(dan);

console.log(
`${dan.firstName} has ${dan.friends.length} friends, and his best friend is called ${dan.friends[0]}`
);

const dan1 = {
firstName: "Dan",
lastName: "Bekenstein",
// age: 2024 - 1994,
job: "Product Manager",
friends: ["Tim", "Justin", "Greg"],
birthYear: 1994,
hasDriversLicense: true,

calcAge: function () {
this.age = 2024 - this.birthYear;
return this.age;
},

getSummary: function () {
return `${this.firstName} is a ${this.calcAge()}-year old ${
this.job
}, and he has ${this.hasDriversLicense ? "a" : "no"} driver's license.`;
},
};
console.log(dan1.calcAge());

console.log(dan1.age);

console.log(dan1.getSummary());
*/

for (let rep = 1; rep <= 10; rep++) {
console.log(`Lifting weights repetition ${rep}`);
}