Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Tell us what’s happening:

Hello I been going at this and I don’t know what’s wrong, everytime I do or try to change something it doesn’t seem to pass!

Your code so far


// User Editable Region

let rows = ["Naomi", "Quincy", "CamperChan"];
rows[3] = 10;
console.log(rows); 

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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 21

Hey i am at the same stage. I believe the error here is that you are putting the number [3] instead of [2]. Remember the array starts with [0] as the first value

The way array indexes work, the first element of the array has index 0. So the third element of the array has index 2.
While index 3 would be wrong for this array.

Edit: also please click reset to restore the original code as you deleted one of the earlier lines of code that is needed. Then retry the step.

remove the space after rows, before the [

after that you will need to remember that arrays are 0-indexed

I believe you are putting [3] instead of [2]. remember array’s starts from 0 for the first value.