Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

#14 - You should assign a value to codingFact for the third time that also contains favoriteLanguage, and log it to the console.

If I delete the last change for codingFact #15 passes. I have been at this for over 4 hours now with the same two numbers. I have switched browsers to Safari, refreshed the webpage, googled the question, copied format (counting spaces), checked through GitHub. I just dont see the issue. Everything is perfect in console, it seems.

Any help is appreciated greatly!

Your code so far

console.log("Hello! I'm your coding fun fact guide!");
let botName = "Ty";
let botLocation = "Mars";
let favoriteLanguage = "Java";
console.log("My name is " + botName + " and I live on " + botLocation + ".")
console.log("My favorite programming language is " + favoriteLanguage + ".")
// First Assignment of codingFact
let codingFact = "I am learning ";
console.log(codingFact + favoriteLanguage + ".")
// Second Assignment of codingFact
codingFact= "The hardest code is " + favoriteLanguage + ".";
console.log(codingFact)
// Third Assignment of codingFact
codingFact = "Botties speak 3 other dialacts of " + favoriteLanguage + "!"
console.log(codingFact)
// Fourth Assignment of codingFact
codingFact = "Bots really love the dialect of " + 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 (Macintosh; Intel Mac OS X 10_15_7) 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

You need exactly 3 assignments, not 4.

correct, If I delete that out, it still fails for #14 and #15 passes

What is you code when you fix the fact that you must have only 3 assignments to the codingFact variable?

Please post your code instead of a picture.

console.log("Hello! I'm your coding fun fact guide!");
let botName = "Ty";
let botLocation = "Mars";
let favoriteLanguage = "Java";
console.log("My name is " + botName + " and I live on " + botLocation + ".")
console.log("My favorite programming language is " + favoriteLanguage + ".")
// First Assignment of codingFact
let codingFact = "I am learning ";
console.log(codingFact + favoriteLanguage + ".")
// Second Assignment of codingFact
codingFact = "The hardest code is " + favoriteLanguage + ".";
console.log(codingFact)
// Third Assignment of codingFact
codingFact = "Botties speak 3 other dialacts of " + favoriteLanguage + "!"
console.log(codingFact)
console.log("It was fun sharing these facts with you. Goodbye! - " + botName + " from " + botLocation + ".")

Now, something is fishy here. The tests are misleading, but this doesn’t exactly match the user story.

  1. You should log the codingFact to the console.
console.log("Hello! I'm your coding fun fact guide!");
let botName = "Ty";
let botLocation = "Mars";
let favoriteLanguage = "Java";
console.log("My name is " + botName + " and I live on " + botLocation + ".")
console.log("My favorite programming language is " + favoriteLanguage + ".")
// First Assignment of codingFact
let codingFact = "I am learning ";
console.log(codingFact)
// Second Assignment of codingFact
codingFact = "The hardest code is " + favoriteLanguage + ".";
console.log(codingFact)
// Third Assignment of codingFact
codingFact = "Botties speak 3 other dialacts of " + favoriteLanguage + "!"
console.log(codingFact)
console.log("It was fun sharing these facts with you. Goodbye! - " + botName + " from " + botLocation + ".")

Now failing on #12 and #14

Ok. Why might that be? Are you correctly meeting all the user stories with the change you made?

Before I made the correction here… (6. You should log the codingFact to the console.), I was only failing #14 and #15, now failing #12 and #14.

I understand that. But you did not answer my question. I would read the user stories and check that the change you made actually is in line with them. (i.e. why were you using the line you previously had?)

let codingFact = "I am learning " + favoriteLanguage;
console.log(codingFact)

so I put the +favoriteLanguage in the console not the String Concatenation.

Thanks for your help!

1 Like

Silly suggestion, but it may be useful for some users (myself included) if it is specified in the instructions exactly how many assignments the test requires to pass. I wrote five, to get in some more practice, and it failed until I deleted two.

Cheers!

codingFact assignment or reassignment is mentioned in user stories 5, 7 and 9, so there is written what you need to do with it