Learn Introductory JavaScript by Building a Pyramid Generator - Step 18

Tell us what’s happening:

I have been stuck on this for a while now. I don’t know what I am doing wrong.
Step 18 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:
let array = [1, 2, 3];
array[1] = 25;
Update the third element of your rows array to be the number 10. Then print the rows array to your cons
console.log(rows[1]);
rows[1] = 10;
console.log(rows[2]);
rows[2] = 10;

Your code so far

let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
console.log(rows[0]);

// User Editable Region

rows[0] = 10;
console.log(rows[1]);
rows[1] = 10;
console.log(rows[2]);
rows[2] = 10;

// 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/123.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 18

Welcome to the forum!

  • You only have to change the third item of the rows array.
  • Also console.log the new value after you have re-declared it, or the terminal will print out the old value.
  • You want to print out the new array as a whole.