Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

I am getting the desired location but I don’t understand why test not passing.

Your code so far

console.log("Hello! I'm your coding fun fact guide!");
let botName = 'Gullu';
let botLocation = 'India';
let favoriteLanguage = 'JS';
console.log("My name is " + botName + " and I live in " + botLocation + ".");
console.log("My favorite programming language is " + favoriteLanguage + ".");
let codingFact = favoriteLanguage + " is world's most popular language.";
console.log(codingFact);
codingFact = favoriteLanguage + " is used to build dynamic websites.";
console.log(codingFact);
codingFact = "It was fun sharing these facts with you. Goodbye! -" + botName + " from " + botLocation + ".";
console.log(codingFact);

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

I changed ‘in’ to ‘on’ in 5th line, 1 test passed, codingFact variables not passing

In above assignment Your string should strat with quote mark, you didn’t have it before the variable favoriteLanguage.

Also that one.

And that one.

And that one doesn’t have the variable favoriteLanguage

I don’t understand it.
favoriteLanguage is already assigned a string value, why should I put it under quote marks ?
and in last there it is not asked to add favoriteLanguage variable.

Remember Strings are always starts with a pair of quote marks. You aren’t using quote mark before the variable in the starting of those strings.

string = " " + variableInTheStarting + " some text of the string.";

Got it, it worked. I deleted everything and started again and did as you said, now I got it. Thank you :slight_smile:

1 Like

there is a bug in this lab that makes mandatory starting the concatenation with a literal string, but it will be fixed soon