Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

I coudn’t pass testing number 14: You should assign a value to codingFact for the third time that also contains favoriteLanguage, and log it to the console.

I have tried:

  • literal string
  • assign codingFact variable starting with some string
  • seperate variable declaration & assignment

All don’t work!

Your code so far

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

let botName;
botName = "Agas";
let botLocation;
botLocation = "Bekasi";
let favoriteLanguage;
favoriteLanguage = "Rust";

console.log(`My name is ${botName} and I live on ${botLocation}.`);

console.log(`My favorite programming language is ${favoriteLanguage}.`);

let codingFact;
codingFact = `The ${favoriteLanguage} programming language was invented by Firefox employee.`;

console.log(codingFact);

codingFact = "This " + favoriteLanguage + " programming language is blazingly fast!"; 

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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Hi

There is no need to have your codingFact variable undeclared at first. Assign the value straight away and that will count as your first assignment of the variable.

You haven’t re-assigned the variable for the third time.

If you do these minor tweaks it should pass.

Thanks, now it’s work!

1 Like

Great well done! I have edited your post to remove the solution as it’s against the forum rules to post solutions. We guide users to help them find the right answer.