Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

I am working on a challenge where I need to reassign a variable named codingFact three times, each time including the favoriteLanguage variable.

While my code seems to meet the requirements, the test for the third reassignment of codingFact is failing.

I suspect the issue might be due to strict formatting expectations in the test case.

Can someone guide me on what exact format is expected or how to debug this type of issue?

My code outputs correctly but isn’t passing the test.

Your code so far

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

//  The bot's name, where it's from, and its favorite coding language, respectively.
const botName = 'Beep-Boop'
const botLocation = 'Far Far Away'
const favoriteLanguage = 'Rizz'

console.log("My name is " + botName +" and I live on "+ botLocation + ".")
console.log("My favorite programming language is " + favoriteLanguage + ".")

// First assignment and log
let codingFact = 'beeeeeeeeep doooopppe??????? BBBBOOOOPPPPP!!!!!! ' + favoriteLanguage;
console.log(codingFact);

// Second assignment and log
codingFact = favoriteLanguage + ' is the coolest programming language ever!';
console.log(codingFact);

// Third assignment and log
codingFact = 'I absolutely love ' + favoriteLanguage + '!';

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/131.0.0.0 Safari/537.36

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

1 Like

you need to put a literal string as first thing, there is a small bug in the test that make it not accept favoriteLanguage as first thing

3 Likes

Hello, I am facing this problem as well. Here is my code and the errors. Can anyone help me? Thanks!

While my code seems to meet the requirements, the test for the step 8 and step 9 .

// Step 1: Log a greeting message to the console

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

// Step 2: Create the required variables

let botName = "BoT";

let botLocation = "the universe";

let favoriteLanguage = "JavaScript";

// Step 3: Use string concatenation to log the bot's introduction

console.log("My name is " + botName + " and I live on " + botLocation + ".");

// Step 4: Use string concatenation to log the bot's favorite programming language

console.log("My favorite programming language is " + favoriteLanguage + ".");

// Step 5: Use let to create a codingFact variable and assign it a fun fact using favoriteLanguage

let codingFact = "I love coding in " + favoriteLanguage + " because it's versatile.";

console.log(codingFact);

// Step 6: Reassign codingFact to a new fact about the favoriteLanguage

codingFact = favoriteLanguage + " is widely used for web development.";

console.log(codingFact);

// Step 7: Reassign codingFact again to another new fact about the favoriteLanguage

codingFact = "Learning " + favoriteLanguage + " opens many doors in tech.";

console.log(codingFact);

// Step 8: Reassign codingFact for the third time to another fact about favoriteLanguage

codingFact = 'Many developers enjoy using ' + favoriteLanguage + ' for its flexibility and community support.';

console.log(codingFact);

// Step 9: Log a farewell message

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

Hi there!

You need to create your own topic to the challenge step using Help button.

hey @sirineOUESLATI

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Get Help > Ask for Help button located on the challenge.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.