Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

Tell us what’s happening:

I keep getting an error message when i try this (let codingFact =(favoriteLanguage) + " is fun, but hard to learn."
console.log((codingFact) + “.”); console.log shows a error message

Your code so far

console.log("Hello! I'm your coding fun fact guide!")
let botName = "Big Bob"
let botLocation = "first street"
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) + " is fun, but hard to learn."
console.log((codingFact) + ".");
codingFact = "Learning " + (favoriteLanguage) + " is a easy way to learn codeing."
console.log((codingFact) + ".");
codingFact = "Workin with " + (favoriteLanguage) +" is a good way to learn codeing."
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/141.0.0.0 Safari/537.36 Edg/141.0.0.0

Challenge Information:

Build a JavaScript Trivia Bot - Build a JavaScript Trivia Bot

console.log( (codingFact) + “.”);

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

Compare your code above to what it is logging below. Can you see the problem?

Workin with javascript is a good way to learn codeing..
NaN from first street.

Your variables do not need to be enclosed in parentheses for string concatenation.

ok, I fixed the (console.log) problem except for the last one

the ( -) should be ( + ) after Goodbye! ?

Yes! Good job finding the issue.

I changed the (-) to (+) and still getting a error

"It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation)." and add the values of the variables. This is what it want’s me to do. the (-) is in there problem

can you show your code?

Note - you really, really do not need to put ( ) around all your variables.

this is my code console.log(“It was fun sharing these facts with you. Goodbye! “- botName + " from " + botLocation +”.”) I get a NaN first street

ok, I’m just starting to learn this, thanks for the info

Please share all of the code.

Note, you cannot subtract strings.

the - is not between quotes, that means you are trying to subtract two strings

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

let botName = "Big Bob"

let botLocation = "first street"

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) + " is fun, but hard to learn."

console.log(codingFact);

codingFact = "Learning " + (favoriteLanguage) + " is a easy way to learn codeing."

console.log(codingFact);

codingFact = "Workin with " + (favoriteLanguage) +" is a good way to learn codeing."

console.log(codingFact);

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

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

This syntax here is saying that you are trying to subtract one string from another, which is not something JavaScript can do.

When I change the ( _- ) to a ( + ) i still get a error message. (“It was fun sharing these facts with you. Goodbye! " + botName + " from " + botLocation +”.") but it reads out on the console

the error message i get // running tests
15. You should log to the console “It was fun sharing these facts with you. Goodbye! - (botName) from (botLocation).” and add the values of the variables.

got to go to work, be back after 4pm

The hyphen after “Goodbye!” should be part of that string.