Build a JavaScript Trivia Bot

I was stuck on the step 11 and 14 for some reason but I did not know what is that about. I went mad and I have found this code :
This code works properly.

console.log("Hello! I'm your coding fun fact guide!");

let botName = "xamarin";
let botLocation = "universe";
let favoriteLanguage = "marshals";

// User Story #1: Omiljeni jezik
console.log("My name is " + botName + " and I live on " + botLocation + ".");
console.log("My favorite programming language is " + favoriteLanguage + ".");

// User Story #2: Fun fact sa favoriteLanguage
let codingFact = "Fun fact: " + favoriteLanguage + " is super versatile and used everywhere!";
console.log(codingFact);

codingFact = "Fun fct: " + favoriteLanguage + " is super versatile and used everywhere!";
console.log(codingFact);

codingFact = "Fun fat: " + favoriteLanguage + " is super versatile and used everywhere!";
console.log(codingFact);


console.log("It was fun sharing these facts with you. Goodbye! - " + botName + " from " + botLocation + ".");

My code was :

console.log("Hello! I'm your coding fun fact guide!");
let botName;
let botLocation;
let favoriteLanguage;
botName = "Xamarin";
botLocation = "Universe";
favoriteLanguage = "Marsually";
console.log("My name is " + botName + " and I live on " + botLocation + ".");
console.log("My favorite programming language is " + favoriteLanguage + ".");

let codingFact = "Fun fact about this coding language " + favoriteLanguage + " is out of this world!";
console.log(codingFact);

codingFact = "Fun fat: " + favoriteLanguage + " cannot be learned by humans, it is just for people from the universe.";
console.log(codingFact);

codingFact = "Fun fct: " + favoriteLanguage + ", is my favourite coding language.";
console.log(codingFact);

codingFact = "It was fun sharing these facts with you. Goodbye! - " + botName + " from " + botLocation + ".";
console.log(codingFact);

Can someone explain to me what was wrong with my code ?
I can not find almost any difference but the text in it.

Please post a link to the challenge or project you are trying.

https://www.freecodecamp.org/learn/full-stack-developer/lab-javascript-trivia-bot/lab-javascript-trivia-bot

Sorry, here it is.

The issue is with the last test actually.

Try this. Comment out these two lines of code.
Then run the tests again.

Notice which test fails? Try to read the test and compare what it wants with what you have above…do you see the problem now?

1 Like

Oh, I am so blind. Thank you very much. Now it is solved, everything works!

1 Like