Learn Introductory JavaScript by Building a Pyramid Generator - Step 11

Tell us what’s happening:

Am not really getting what exactly they want me to do I have changed the variable but still the same error message

Your code so far

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

// User Editable Region

secondCharacter = "World";

// User Editable Region

console.log(secondCharacter);

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 11

Hello @jonathanssengonzi2

You have hard coded again the string “World” which is already present a few lines above what you wrote.

You need to reassign the secondCharacter to the character variable.

secondCharacter assignment from "Test" to your character variable

This means that you need assign, the character variable to the secondCharacter variable. Not assign the value of the character variable, which is "World" to the secondCharacter variable.

Thanks but still it deosnt pass

Can you share your latest code for me to review?

Tell us what’s happening:

What does this step really want for sure???I have tried everything possible but still it doesn’t pass

Your code so far

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

// User Editable Region

secondCharacter = "character";

// User Editable Region

console.log(secondCharacter);

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 11

The “character” here is a variable, not a string.

1 Like

Hi there,

First of all, do you understand the given example in the instruction?

let first = "One";
let second = "Two";
second = first;

Before we set second = first:

  • first value is "One"
  • second value is "Two"

After we set second = first:

  • first value is still "One"
  • second value is not "Two" anymore. second value now is "One"

Now, in our code, we have on line 3:

character = "World";

and on line 5:

secondCharacter = "Test";

What the instruction asked is:

change your secondCharacter assignment from "Test" to your character variable

that means: change line 5 to something similar to:

second = first;

and then look at the console on the right to see the value of secondCharacter is not "Test" anymore, but is similar to the value of character.

@jonathanssengonzi2 Please do not create duplicate threads for the same challenge. I have merged your threads.

You can post your updated code in this thread. You do not need to create a new thread.


When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

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

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