Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

At first, my facts weren’t working so I changed this:

let codingFact = “Here’s my fact”
console.log(codingFact + favoriteLanguage + “.”);

to
let codingFact = “Here’s my fact” + favoriteLanguage + “.”
console.log(codingFact);

But when I did that, it made all of my tasks except for one no longer correct. What happened?

Your code so far

console.log("Hello! I'm your coding fun fact guide!");
const botName = "Bob";
const botLocation = "Australia";
const favoriteLanguage = "Pig Latin";
console.log("My name is " + botName + " and I live on " + botLocation + ".");
console.log("My favorite programming language is "+ favoriteLanguage + ".");
let codingFact = "Coding is super cool and uses my favorite coding language, " + favoriteLanguage + ".";
console.log(codingFact);
codingFact = "The first language I ever learned was " + favoriteLanguage + ".";
console.log (codingFact);
codingFact = "Do you know how to use " + codingLanguage + ".";
console.log (codingFact);
console.log("It was fun sharing these facts with you. Goodbye! - " + botName + " from " + botLocation + ".");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

The console suggests you are using an undefined variable in your code.

Happy coding

I saw I accidentally put codingLanguage instead of favoriteLanguage. I fixed that, but 13 and 14 are still showing up as incomplete.

Found it! I had a space in between console.log and (codingFact). Thank you!

1 Like