Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

Everything I wrote in the script field appears to be wrong. Is there a problem with ‘Trivia Bot Lab,’ or am I doing something wrong?

Your code so far

console.log("Hello! I'm your coding fun fact guide!");
let botName;
let botLocation;
let favoriteLanguage;
botName = "AtaG.";
botLocation = "Computer Memory";
favoriteLanguage = "JavaScript";
console.log("My name is " + botName + " and I live on " botLocation + ".");
console.log("My favorite programming language is " + favoriteLanguage + ".")
let codingFact;
codingFact = "Despite " + favoriteLanguage + " is my favorite language, I just started to learn it.";
console.log(codingFact);
codingFact = "I started to enjoy about learning " + favoriteLanguage + ".";
console.log(codingFact);
codingFact="Do not give up about " + favoriteLanguage + "." + " If you want to learn too.";
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/134.0.0.0 Safari/537.36

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Welcome to the forum @atagul0819

You have a syntax error message in the console.

SyntaxError: unknown: Unexpected token, expected "," (8:56)

   6 | botLocation = "Computer Memory";
   7 | favoriteLanguage = "JavaScript";
>  8 | console.log("My name is " + botName + " and I live on " botLocation + ".");
     |                                                         ^
   9 | console.log("My favorite programming language is " + favoriteLanguage + ".")
  10 | let codingFact;
  11 | codingFact = "Despite " + favoriteLanguage + " is my favorite language, I just started to learn it.";

The > symbol indicates there is an issue with line 8 of the JavaScript.
The ^ symbol indicates the position in the line where the error occurs.

The numbers at the end of top line also give you this information (8:56)

Happy coding

1 Like

Thank you for your reply. It worked but isn’t it odd that bcs of one line all the code is appears as wrong. Thank you again.

JavaScript is a fragile language. Just one syntax error, such as a keyword typo or missing concatenation, can stop the execution of the whole code.