Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

I got struck in the Arrays are special in that they are considered mutable. This means you can change the value at an index directly.

For example, this code would assign the number 25 to the second element in the array:

Example Code

let array = [1, 2, 3];
array[1] = 25;
console.log(array); // prints [1, 25, 3]

Update the third element of your rows array to be the number 10. Then print the rows array to your console.

My answer is
let rows = [1,2,3];

rows[2] = 10;

console.log(rows);
where i’m making mistake?

can you share the link to the step?

also please check the console for any errors

this is the console reply
// running tests 1. You should use bracket notation on the

rows

array again. 5. You should have a second

console.log

statement in your code. // tests completed // console output [ 1, 2, 10 ]

do you not see this?

SyntaxError: unknown: Identifier 'rows' has already been declared. (5:4)

  3 | let rows = ["Naomi", "Quincy", "CamperChan"];
  4 | console.log(rows[0]);
> 5 | let rows = [1,2,3];
    |     ^
  6 |
  7 | rows[2] = 10;

I still have this problem and my screenshot is this.

hi @yhamari , please create your own topic, we are unable to help you in someone else’s topic

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.