Issue in excercise https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements

In the following excercise there is an issue : https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements

The following is my solution but not passing the test even though for a false parameter it is working perfectly…


function trueOrFalse(wasThatTrue) {
  // Only change code below this line
  if(wasThatTrue === true){
    return "Yes, that was true";
  } else {
    return "It was false";
  }


  // Only change code above this line

}
console.log(trueOrFalse(false))

// running tests

trueOrFalse(false)

should return “No, that was false” // tests completed //

console output It was false

Hello~!

This line is incorrect. Take a look at what the tests expect you to return here. :slight_smile:

1 Like

Thank you, you were right, the string was wrong!!

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

Please use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks are not single quotes.

markdown_Forums

2 Likes