Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

Tests 8. 10. and 11. are not passing for some reason, I believe I did everything correctly.

Your code so far

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

let botName = "Optimus";
let botLocation = "Earth";
let favoriteLanguage = "JavaScript";

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

let codingFact = favoriteLanguage + " was created in 10 days.";
console.log(codingFact);

codingFact = favoriteLanguage + " can be used for web development.";
console.log(codingFact);

codingFact = favoriteLanguage + " is versatile and beginner-friendly.";
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 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

// running tests
8. You should give codingFact a value  that includes favoriteLanguage using concatenation.
10. You should assign a new value to codingFact that also contains favoriteLanguage, and log it to the console.
11. 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 Optimus and I live on Earth.
My favorite programming language is JavaScript.
JavaScript was created in 10 days.
JavaScript can be used for web development.
JavaScript is versatile and beginner-friendly.
It was fun sharing these facts with you. Goodbye! - Optimus from Earth.
[TypeError: codeWithoutComments.match(...) is null]
[TypeError: codeWithoutComments.match(...) is null]
[TypeError: codeWithoutComments.match(...) is null]

The tests don’t like it when you concatenate with the variable favoriteLanguage at the beginning. If you somehow rearrange those strings so that each version of codingFact begins with a string value, followed by favoriteLanguage, you should pass all of the tests.

1 Like