Learn Introductory JavaScript by Building a Pyramid Generator - Step 10

Tell us what’s happening:

It is telling me to “assign” the string test to my secondCharacter variable. I don’t understand where to put my “test” string. I am on step 10 of Introductory Javascript by building a Pyramid Generator. Please do help me
My code is:
let secondCharacter;
console.log(secondCharacter);
let secondCharacter;
secondCharacter = " ";

Your code so far


// User Editable Region

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


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 10

Welcome to the forum @rokan23

Please remove the line of code indicated below.

Variables declared with the let keyword can be declared only once.

The next hint message will show you what to do to complete the challenge.

Happy coding

You’ll notice that this line

Differs from this one.

The first is declared and initialized while the second is only declared. To declare is to form a variable while to initialize is to give the variable a value.

Give your secondCharacter variable a value

Yea, thats what i thought, yet it still says “I should add the ‘string’ test to the variable.”
It’s teaching me to add a value to a "unitialized variable. i will try to follow your advice, thanks

Thanks Teller, I’ll try it.

1 Like

Ok so it worked! Thank you teller and stephen!

1 Like

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