Learn Introductory JavaScript by Building a Pyramid Generator - Step 11

Tell us what’s happening:

been stuck on this code for a while need help please

Your code so far

let character = 'Hello';
console.log(character);
character = "World";
let secondCharacter;

// User Editable Region

secondCharacter = "Test";
let character = "World";
secondcharacter= character; 

// User Editable Region

console.log(secondCharacter);

Your browser information:

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 11

Welcome to the forum @zepple

You have an error message in the console.

SyntaxError: unknown: Identifier ‘character’ has already been declared. (9:4)
7 |
8 | secondCharacter = “Test”; >
9 | let character = “World”; | ^
10 | secondcharacter= character;
11 |
12 | // User Editable Region

The blue dots indicate a typo in the variable name.
image

Happy coding

how do i fix the error in the console

Your code in the editor has a typo for the variable name.
When you fix that, the syntax error will disappear from the console.

i fixed the error but the code didn’t pass its telling me no to assign the value test to my character variable.

Hi @zepple

Here is a comparison of the original code and your code.

The code in blue is the original code, the code in red is your code.
The code in magenta is the overlap.

Please remove second declaration of the character variable.

Happy coding

thanks for your help my code passed

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.