Full Stack Morning Oct-8-2021

Full Stack Morning Oct-8-2021

Scratchpad #1

Scratchpad #2 and #3

Scratchpad #4

Scratchpad #2 – JS

// let isUserLoggedIn = true;

// if (isUserLoggedIn) {
//   console.log("This is the result");
// }

// console.log("This is the last line outside the conditional");

// let num = 12;

// if (num % 2 === 0) {
//   console.log("Number is even");
// } else {
//   console.log("Number is odd");
// }

// let age = 70;

// if (age > 18) {
//   console.log("Entry Granted!");
// } else if (age >= 21) {
//   console.log("Drinks Allowed");
// } else if (age >= 65) {
//   console.log("Drinks FREE!");
// } else {
//   console.log("You are not allowed");
// }

// let age = 67;

// if (age > 18) {
//   if (age >= 65) {
//     console.log("Drinks FREE!");
//   } else if (age >= 21) {
//     console.log("Drinks Allowed");
//   } else {
//     console.log("You can enter but you cannot drink");
//   }
// } else {
//   console.log("Get lost!");
// }

// let password = "helloworld@123";

// if (password.length >= 6) {
//   if (password.indexOf(" ") !== -1) {
//     console.log("Password cannot include spaces");
//   } else {
//     console.log("Valid Password");
//   }
// } else {
//   console.log("password is too short");
// }

// let age = 20;

// if (age >= 18 && age < 21) {
//   console.log("Entry Granted!");
// } else if (age >= 21 && age < 65) {
//   console.log("Drinks Allowed");
// } else if (age >= 65) {
//   console.log("Drinks FREE!");
// } else {
//   console.log("You are not allowed");
// }

// let day = 3;

// if (day === 1) {
//   console.log("It's monday");
// } else if (day === 2) {
//   console.log("It's tuesday");
// } else if (day === 3) {
//   console.log("It's Wednesday");
// } else {
//   console.log("Invalid day code");
// }

// let day = 1;

// switch (day) {
//   case 1:
//   case 2:
//     console.log("Tuesday");
//     break;
//   case 3:
//     console.log("Wednesday");
//     break;
//   case 4:
//     console.log("Thursday");
//     break;
//   case 5:
//     console.log("Friday");
//     break;
//   case 6:
//     console.log("Saturday");
//     break;
//   case 7:
//     console.log("Sunday");
//     break;
//   default:
//     console.log("This is not a day");
// }

// let age = 70;

// age >= 18 ? console.log("You can enter") : console.log("Not allowed");

// let canEnter = age >= 18 ? true : false;

// age >= 18 && age < 21
//   ? console.log("You can enter")
//   : age >= 21 && age < 65
//   ? console.log("You can drink")
//   : age >= 65
//   ? console.log("Drinks are free")
//   : console.log("Get lost");

let cart = 10;

console.log("You have " + cart + " items in your cart.");

console.log(`You have ${cart} items in your cart`);