JS Assignment 4: Control Flow Continued
BrianTran2 (17)

Is anyone doing LambdaSchool JavaScript pretest because I have worked for 40 minutes and I can get question 3 from assignment 4 correct.

You are viewing a single comment. View All
Shif (3)

@Cwill14 this may "pass" - but I dont think it fulfills the request in the assignment:

// Using an if/else if/else statement *assign typeOfLicense to*

Here is a solution to consider that assigns typeOfLicense to Full/Permit/None:

function exerciseFour(age){
  let typeOfLicense;
  // In this exercise, you will be given a variable, it will be called: age
  // You are also given another variable called: typeOfLicense;
  // Using an if/else if/else statement assign typeOfLicense to:
    // 'Full License' if age is greater than or equal to 16,
    // 'Permit' if age is equal to 15,
    // 'None' if age is less than 15
    if (age >=16) {
      typeOfLicense = 'Full License';
  } else if (age === 15) {
      typeOfLicense = 'Permit';
  } else {
      typeOfLicense = 'None';

  // Please write your answer in the line above.
  return typeOfLicense;