2
Introduction to control flow question
silverflag22 (3)
function exerciseFour(value){
  let greaterThanFive = false;
  // In this exercise, you will be given a variable, it will be called: value
  // You will also be given a variable named: greaterThanFive
  // Using an 'if' statement check to see if the value is greater than 5. If it is, re-assign greaterThanFive the boolean true.
 
  
  // Please write your answer in the line above.
  return greaterThanFive;
}

function exerciseFive(name){
  let isSondra = false;
  // In this exercise, you will be given a variable, it will be called: name
  // You will also be given a variable named: isSondra
  // Using an 'if' statement check to see if the name is equal to the string 'Sondra'. If it is, re-assign isSondra the boolean true.
  
  
  
  // Please write your answer in the line above.
  return isSondra;
}

Need help answering these two questions. Thanks!

You are viewing a single comment. View All
1
eankeen (530)

Hi! I reformatted your question to make it a bit easier for others to understand. :)

With JavaScript, if statements look like this:

if(someValue > 10) {
   someBoolean = true;
}

If you want to test for a string, you may want to do something like someValue == "someString" instead of someValue > 10.

I would recommend looking at this page or this page if you want to learn more.

Hopefully I was able to help =P