Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

Tell us what’s happening:

I’m not able to understand what we’ve to do. Have been trying since past half an hour.

Your code so far

let character = 'Hello';
let count = 8;

// User Editable Region

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

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 21

hi and welcome to the forum!

For this step there are 2 things requested.
1- update the third element of the array
2- print the array

Which one are you having trouble understanding how to do? (or both?)

It should be like this :

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

Just this but after I entered the code there pops an error showing invalidity and incorrect code. Can you tell me what the exact answer is.

Hi there!
Copy that above code, reset your challenge step and paste the code again. Then try to check your code.

I got it done correctly. I was stuck since past two days. Thank you so much for helping me get it done.

1 Like

Your welcome. Actually you previously had extra line of wrong and unnecessary code there in the editor. Because of that, your challenge step was prevented from passing.