Build a Greeting Bot - Step 10

Tell us what’s happening:

Subject/Title: Bug in Build a Greeting Bot - Step 10: Test Fails Despite Correct Code

Challenge: Build a Greeting Bot, Step 10

URL: Build a Greeting Bot: Step 10 | freeCodeCamp.org

Issue: The test for Step 10 fails with the error message: “You should have a console statement in your code.” However, my code includes a console.log statement, and the console outputs the expected result: My nickname is professorBot.. I believe this might be a bug in the test or a platform issue.

Your code so far


// User Editable Region

let bot = "professorBot";
let nicknameIntroduction;
nicknameIntroduction = "My nickname is " + bot + ".";
console.log(nicknameIntroduction);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36

Challenge Information:

Build a Greeting Bot - Step 10

Welcome to the forum @madhavapavan555

SyntaxError: unknown: Identifier 'bot' has already been declared. (22:4)

  20 | // User Editable Region
  21 |
> 22 | let bot = "professorBot";
     |     ^
  23 | let nicknameIntroduction;
  24 | nicknameIntroduction = "My nickname is " + bot + ".";
  25 | console.log(nicknameIntroduction);

There is a message in the console.

It looks like JavaScript does not like it when a variable is declared twice.

Happy coding