Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

There’s a bug in the test that is not allowing me to pass the test and move to the next lesson. Can you please show me how to add the literal string to make my test pass? Or better yet fix the bug!!

Your code so far

console.log("Hello! I'm your coding fun fact guide!");
let botName = "Bottie";
let botLocation = "Philly";
let favoriteLanguage = "html";
console.log(" My name is "  + "" + botName + "" + 
" and I live on " + "" + botLocation + ".");
console.log(" My favorite programming language is " + "" + favoriteLanguage + ".");
let codingFact = "I can create a word document and make it interactive with " + "" + favoriteLanguage + ".";
console.log (codingFact);
codingFact =" Super easy to code with " + "" + favoriteLanguage + ".";
console.log(codingFact);
codingFact = " You can code nice websites with " + "" + 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 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Why are you concatenating with empty strings? This could be tripping up the tests as it’s entirely unnecessary. Try fixing all instances of that then test your code again. Post your updated code if you still need help.

UPDATE: I also notice you have added an extra space at the beginning of strings being logged. The tests will expect you to log exactly what is asked.

hi i did what was asked, it runs well in the console but won’t pass the test.

// running tests 8. You should log to the console

"My name is (botName) and I live on (botLocation)."

using concatenation to add the variables to the string. 9. You should log to the console

"My favorite programming language is (favoriteLanguage)."

using concatenation to add the variable to the string. 14. You should assign a value to

codingFact

for the third time that also contains

favoriteLanguage

, and log it to the console. 15. You should log to the console

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

using concatenation to add the values of the variables. // tests completed // console output Hello! I’m your coding fun fact guide! My name is Bottie and I live on Philly. My favorite programming language is html. I can create a word document and make it interactive with html. Super easy to code with html. You can code nice websites with html. It was fun sharing these facts with you. Goodbye! - Bottie from Philly.

Would you post your updated code, please?

Also, you asked about template literals. Here’s a link that should help:

Working with Strings in JavaScript - What Are Template Literals, and What Is String Interpolation? | Learn | freeCodeCamp.org

hi I didn’t change a thing because the code works it’s just not passing the test. I read in the help section that there’s a bug in the test . ILMfreeCodeCamp Staff

Jan 2

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

That does not apply to your code. Fix your code as suggested and it should pass.

I don’t see anything to fix…

console.log(“Hello! I’m your coding fun fact guide!”);

let botName = “Bottie”;

let botLocation = “Philly”;

let favoriteLanguage = “html”;

console.log("My name is " + botName +

" and I live on " + botLocation + “.”);

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

let codingFact = "I can create a word document and make it interactive with " + “” + favoriteLanguage + “.”;

console.log (codingFact);

codingFact ="Super easy to code with " + favoriteLanguage + “.”;

console.log(codingFact);

codingFact ="You can code nice websites with " + favoriteLanguage + “.”;

console.log(codingFact);

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

thanks Im still getting an error for 14.
You should assign a value to

codingFact

for the third time that also contains

favoriteLanguage

, and log it to the console. // tests completed // console output Hello! I’m your coding fun fact guide! My name is Bottie and I live on Philly. My favorite programming language is html. I can create a word document and make it interactive with html. Super easy to code with html. You can code nice websites with html. It was fun sharing these facts with you. Goodbye! - Bottie from Philly.

hi this topic is not solved. can I please get some help?

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.

You can also 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 (').

1 Like

You are still concatenating an empty string in one of your coding facts.

that post is from January 2, the bug has been fixed