samedi 20 juillet 2019

How do I properly answer this exercise? I don't know what the answer should look like

Is the exercise asking for multiple lines or 1 line? it keeps telling me its wrong. I don't know why. I've tried googling but I haven't found anything that makes sense to me. Please help!

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;
} 

Aucun commentaire:

Enregistrer un commentaire